Home » KBArticles » VBScript to check Citrix Logons

VBScript to check Citrix Logons

This script will run for all listed citrix servers to check if logons are enabled or disabled remotely.
its just a remote registry query coupled with an array, basic but functional.. 🙂

—————————————————————————————————-
‘START SCRIPT
const HKEY_LOCAL_MACHINE = &H80000002
Dim oReg, strKeyPath, strValueName, strDisabled, objArgs, strComputer, arrComputers
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
‘END SCRIPT
—————————————————————————————————-

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.