码迷,mamicode.com
首页 > 其他好文 > 详细

BGinfo配置策略

时间:2018-01-05 16:54:46      阅读:971      评论:0      收藏:0      [点我收藏+]

标签:roo   计算   work   script   config   evel   mic   内容   ola   


策略:计算机配置-策略-Windows设置-脚本-启动

脚本:井号内为脚本内容

############################################################

@echo off
Del C:\Users\%username%\AppData\Local\Temp /Q
net use z: \\hbgslz.com\netlogon\bginfo
z:
bginfo.exe bginfo.bgi /timer:00 /nolicprompt
net use z: /del /y


###########################################################

 

附:

1.Only IPv4 Address.vbs

 

####################################################################################

' Special BGInfo Script

' Only IPv4 Address v1.7

' Programmed by WindowsStar - Copyright (c) 2009-2011

' --------------------------------------------------------

 

strComputer = "."

On Error Resume Next

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'")

 

For Each objIP in colSettings

For i=LBound(objIP.IPAddress) to UBound(objIP.IPAddress)

If InStr(objIP.IPAddress(i),":") = 0 Then Echo objIP.IPAddress(i)

Next

Next

######################################################################################

 

2.Only IPv6 Address.vbs

 

######################################################################################

' Special BGInfo Script

' Only IPv6 Address v1.7

' Programmed by WindowsStar - Copyright (c) 2009-2011

' --------------------------------------------------------

 

strComputer = "."

On Error Resume Next

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'")

 

For Each objIP in colSettings

For i=LBound(objIP.IPAddress) to UBound(objIP.IPAddress)

If InStr(objIP.IPAddress(i),":") <> 0 Then Echo objIP.IPAddress(i)

Next

Next

######################################################################################

 

3.Operating System Information.vbs

 

##############################################################################################################

' Special BGInfo Script

' Operating System Information v1.3

' Programmed by WindowsStar - Copyright (c) 2009-2010

' --------------------------------------------------------

 

strComputer = "."

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

 

Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

 

For Each objOperatingSystem in colOperatingSystems

OSCaption = Trim(Replace(objOperatingSystem.Caption,"Microsoft ",""))

OSCaption = Replace(OSCaption,"Microsoft","")

OSCaption = Replace(OSCaption,"(R)","")

OSCaption = Trim(Replace(OSCaption,",",""))

Echo OSCaption

Next

#############################################################################################################

 

4.OS Architecture.vbs

 

#############################################################################################################

' Special BGInfo Script

' OS Architecture v1.5

' Programmed by WindowsStar - Copyright (c) 2009

' ---------------------------------------------------

 

strComputer = "."

On Error Resume Next

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery ("Select * from Win32_Processor")

For Each objComputer in colSettings

If objComputer.Architecture = 0 Then ArchitectureType = "32Bit"

If objComputer.Architecture = 6 Then ArchitectureType = "Intel Itanium"

If objComputer.Architecture = 9 Then ArchitectureType = "64Bit"

Next

 

Echo ArchitectureType

###############################################################################################################

 

5.常见WMI筛选

1. Active DNS - WMI Query - SELECT DNSServerSearchOrder FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'

2. Active IP - WMI Query - SELECT IPAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'

3. Active MAC Address - WMI Query - SELECT MACAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'

4. Active Subnet Mask - WMI Query - SELECT IPSubnet FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'

5. Manufacturer - WMI Query - SELECT Manufacturer FROM Win32_ComputerSystem

6. Model - WMI Query - SELECT Model FROM Win32_ComputerSystem

7. OS and Edition - Registry Value - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName

8. OS Architecture - WMI Query - SELECT OSArchitecture FROM Win32_OperatingSystem

9. OS Architecture XP2K3 - Registry Value - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE

10. Workgroup - WMI Query - SELECT Workgroup FROM Win32_ComputerSystem


BGinfo配置策略

标签:roo   计算   work   script   config   evel   mic   内容   ola   

原文地址:http://blog.51cto.com/hbgslz/2057830

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!