BGinfo配置策略

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了BGinfo配置策略相关的知识,希望对你有一定的参考价值。


策略:计算机配置-策略-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配置策略的主要内容,如果未能解决你的问题,请参考以下文章

为域中服务器部署Bginfo软件(初稿未完成)

实用工具特别推荐 BGInfo

Azure Windows VM Bginfo

使用活动目录组策略添加客户端端远程开机自动运行程序

任务计划程序 BAT、PS1、VBS,无法运行

是否可以在OnStop()上回收所有数据并使用保留片段?