Posts RSS Comments RSS 253 Posts and 411 Comments till now

Get-CitrixFarm (Playing Around Series)

I wanted to show how EASY it is to play with Citrix MFCom so here is a little video.

I also want to note how most of the properties (like Servers,Applications,Zones) all return objects that have their own properties and methods. So you could very easily have these lines in your profile and always have everything just sitting there waiting to be used.

$farm = New-Object -Com ‘MetaframeCOM.MetaFrameFarm’
$farm.Initialize(1)
Write-Host "Loaded Farm Info from $($farm.FarmName)

Best Viewed Full Screen

Get the Flash Player to see this content.


Demo File

# Get Citrix Farm Object
#
$farm = New-Object -Com ‘MetaframeCOM.MetaFrameFarm’
#
# Initialize Farm
#
$farm.Initialize(1)
#
# Now that we have are farm. Lets make sure we have the one we want by Getting the FarmName
$Farm.FarmName
#
# Lets see what we have to play with
#
$farm | Get-Member -type Properties
#
#
# We have the Farm we want. Some of the Info we want is Admins. So lets Start there
#
$farm.Admins
#
# To View just a list
#
$farm.Admins | Select FriendlyName
#
# Lets see what Applications we have
#
$farm.Applications | ft BrowserName,ParentFolderDN
#
# To View the Servers
#
$farm.Servers | ft ServerName,IPAddress,SessionCount
#
# How bout Sessions?
$farm.Sessions
#
# Lets look at Print Drivers we Have installed
#
$farm.Drivers
#
# If you have multiple Zones you can get the Names Servers and DataCollector for the Zone
$farm.Zones
#

Trackback this post | Feed on Comments to this post

Leave a Reply

You must be logged in to post a comment.