Thursday, November 3

List servers and folders from Citrix console

Execute this with CScript if it is not your default script host:

Set theFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")
thefarm.Initialize 1

Sub getServers(folderDN)
Set srvFolder = CreateObject("MetaFrameCOM.MetaFrameFolder")
srvFolder.Initialize 13, folderDN

For each server in srvFolder.SrvFolder.Servers
wscript.echo server.ServerName
Next

For each folder in srvFolder.SubFolders

wscript.echo folder.FolderName
getServers(folder.FolderDN)
Next
End Sub

getServers("Servers")

No comments:

Post a Comment