To find SCCM Client have the SUP server Registry key value status
This script will check Weather the Client system is scanning properly with SUP server or not
============================================================================================================================================================================================================================================================
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_LOCAL_MACHINE = &H80000002
Set Fso = CreateObject("Scripting.FileSystemObject")
Set InputFile = fso.OpenTextFile("MachineList.Txt")
Do While Not (InputFile.atEndOfStream)
strComputer = InputFile.ReadLine
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
strValueName = "WUServer"
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
If IsNull(dwValue) Then
Wscript.Echo "The registry key does not exist. (" & dwValue & ") and computer name" & StrComputer
Else
Wscript.Echo "The registry key exists. (" & dwValue & ") and computer name" & StrComputer
End If
Wscript.Echo "The registry key does not exist. (" & dwValue & ") and computer name" & StrComputer
Else
Wscript.Echo "The registry key exists. (" & dwValue & ") and computer name" & StrComputer
End If
Loop
''''HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate
''''HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate
No comments:
Post a Comment