SCRIPT: check Xen servers logons enabled
‘vbscript
const HKEY_LOCAL_MACHINE = &H80000002
Dim oReg, strKeyPath, strValueName, strDisabled, objArgs, strComputer, arrComputers
Set objArgs = WScript.Arguments
arrComputers = Array(“server1″,”server2”)
sOutput = “Logons Enabled(0) or Disabled(1)” & VBCRLF & VBCRLF
For EACH strComputer in arrComputers
Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & strComputer & “rootdefault:StdRegProv”)
strKeyPath = “SoftwareMicrosoftWindows NTCurrentVersionWinlogon”
strValueName = “WinStationsDisabled”
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strDisabled
sOutput = sOutput & strcomputer & ” ” & strDisabled & vbcrlf
On Error Resume Next
Next
wscript.echo sOutput