Pages

Monday, February 6, 2012

Notes on Citrix XenApp 6.5 PowerShell cmdlets

Having worked with Microsoft Exchange 2000, 2003, 2007 and finally 2010, I’ve come to appreciate what Microsoft has done and how mature Exchange 2010 PowerShell cmdlets are today.  There really isn’t a whole lot you can’t do with the cmdlets and while most administrators including myself probably only use 5% (if even) what it’s capable of, I know if I needed to automate a task that the GUI doesn’t allow you to, PowerShell will be able to do so.  Now moving onwards to Citrix, it’s great that they have adopted PowerShell but I find that it still needs a few iterations before it’s as powerful as what PowerShell does for Exchange.  Anyways, I digress.  The following are just some of my Citrix PowerShell notes that I’ll continue to build towards as I develop my toolkit for Citrix XenApp.

List XenApp Applications

List all applications:
Get-XAApplication

List all applications and pipe to file:
Get-XAApplication > C:\XenAppApplications.txt

List a specific application based on BrowserName variable:
Get-XAApplication -BrowserName "Microsoft Word 2010"

List applications based on BrowserName with a wild card:
Get-XAApplication -BrowserName Microsoft*

List applications with a variable equal to a value you specify:
Get-XAApplication -BrowserName Microsoft* | where-object {$_.Enabled -match "False"} | Format-Table DisplayName

**Note that Enabled is the checkbox here:

image

Alternatively, you can use another variable such as HideWhenDisabled:

image

… and if you want to use other variables, you can review the attributes available via the

Get-XAApplication

… which outputs information similar to the following:

image

List applications that start with “Microsoft” and its specific attributes:
Get-XAApplication -BrowserName Microsoft* | Format-Table DisplayName, CommandLineExecutable

List the “DisplayName” attribute’s value of applications in a folder named “Office 2010 SP1”:
Get-XAApplication -FolderPath Applications\"Office 2010 SP1" | Format-table DisplayName

Modify XenApp Applications

Set all of the applications in a folder named “Office 2010 SP1” to be published on a (one) server:
Get-XAApplication -FolderPath Applications\"Office 2010 SP1" | Set-XAApplication -ServerNames <serverName>

**Note that the above command will overwrite the servers that the application is published in with the server you specify.  Please replace <serverName> with the name of the server you want to use to publish the applications.

Set all of the applications in a folder named “Office 2010 SP1” to be published on multiple servers:
Get-XAApplication -FolderPath Applications\"Office 2010 SP1" | Set-XAApplication -ServerNames <serverName1>, <serverName2>

Set the “Client Application Folder” properties field for all of the applications in a folder named “Clinical Apps” under the folder “Published” to “Clinical Apps”:
Get-XAApplication -FolderPath Applications\Published\"Clinical Apps" | Set-XAApplication -ClientFolder "Clinical Apps"

Set access rights for Group1 and Group2 to all of the applications in a folder named “Web Browsers” that’s located in another folder named “Published”:
Get-XAApplication -folderpath applications\Published\"Web Browsers" | Set-XAApplication -Account
domain\group1,domain\group2

**Note that the above command will overwrite the permissions currently set for the applications.

I’ll append to this post another day with more modifying cmdlets.

3 comments:

Anonymous said...

Blah Blah Blah Lukie, Yawn.

Anonymous said...

yup... a real snoozer for sures lol

Keith said...

This is great! Thanks for the examples!