Get-CitrixServer (Playing Around Series)
This is a quick run through a MFCOm Citrix Server Object
Best Viewed Full Screen
Get the Flash Player to see this content.
Demo File
#
# We start by creating a Server Object
#
$mfsrv = New-Object -ComObject MetaFrameCOM.MetaFrameServer
#
# Initializing Server
#
$mfsrv.Initialize(6,$ENV:ComputerName)
#
# Now we have are server… Lets see what we have to play with
#
$mfsrv | Get-Member -type Properties
#
# Lets start by looking at the current sessions on the server
#
$mfsrv.Sessions | ft SessionID,AppName,ClientAddress,ClientHRes,ClientVRes -auto
#
# What about what Zone it is in?
#
$mfsrv.ZoneName
#
# Printers?
#
$mfsrv.Printers
#
# Lets see what Processes are running
#
$mfsrv.Processes | ft SessionID,ProcessID,UserName,ProcessState -auto
#
# A common task is Server Load
#
$mfsrv.WinServerObject.ServerLoad
#
# Last (and perhaps most important) What applications?
#
$mfsrv.Applications | ft BrowserName,ParentFolderDN
# We start by creating a Server Object
#
$mfsrv = New-Object -ComObject MetaFrameCOM.MetaFrameServer
#
# Initializing Server
#
$mfsrv.Initialize(6,$ENV:ComputerName)
#
# Now we have are server… Lets see what we have to play with
#
$mfsrv | Get-Member -type Properties
#
# Lets start by looking at the current sessions on the server
#
$mfsrv.Sessions | ft SessionID,AppName,ClientAddress,ClientHRes,ClientVRes -auto
#
# What about what Zone it is in?
#
$mfsrv.ZoneName
#
# Printers?
#
$mfsrv.Printers
#
# Lets see what Processes are running
#
$mfsrv.Processes | ft SessionID,ProcessID,UserName,ProcessState -auto
#
# A common task is Server Load
#
$mfsrv.WinServerObject.ServerLoad
#
# Last (and perhaps most important) What applications?
#
$mfsrv.Applications | ft BrowserName,ParentFolderDN

