1. 程式人生 > >BGinfo配置策略

BGinfo配置策略

策略 ipaddr ssi temp enabled architect then mod com


策略:計算機配置-策略-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配置策略