How To Create XenApp Published Applications for Test In Just Seconds Using PowerShell

Prerequisite: XenApp6 PowerShell SDK

Let’s say you want to copy all currently published applications into a folder named “Test” in the console tree, while simultaneously modifying the new published apps with different permissions and client folder settings. Here’s how:

First, create the “Test” folder by hand (you can use New-XAFolder -FolderPath Applications\Test if you are so inclined), then use the following command to copy the applications into it:

get-XAApplication | Copy-XAApplication  -folderpath Applications\Test

Second, modify the published application properties to set the client folder (what folder the applications show up under in Program Neighborhood or Web Interface), and the permissions in one fell swoop. We’ll call the client folder “Test” and publish to the groups “domain1\citrix admins” and “domain2\Test Users”:

Get-XAApplication -folderpath Applications\Test | set-xaapplication -clientfolder Test -accounts "domain1\citrix admins","domain2\Test Users"

That’s it! Now doesn’t that beat right-click -> “Duplicate Application”?

Citrix XenApp6 0x80060016 Error In PowerShell

I ran into a little snag when executing some XenApp PowerShell commands. Certain commands like Get-XAFarm and Get-XAAdministrator would always give an “0x80060016” error. Here is an example and the fix:

PS C:\Windows\system32> Get-XAFarm
Get-XAFarm : Error reading the current administrator data (0x80060016)
At line:1 char:11
+ Get-XAFarm <<<<
+ CategoryInfo : InvalidResult: (:) [Get-XAFarm], CitrixException
+ FullyQualifiedErrorId : GetCitrixAdminType,Citrix.XenApp.Commands.GetFarmCmdlet

Typically this error code in Citrix indicates a problem with IMA. But in this case it was even simpler than that: IMA couldn’t resolve the hostname of the database server hosting the data store. Make sure that the correct DNS suffixes are being applied so IMA can find the server, and if that fails, just add it to the hosts file and try again.

The Coming Citrix-Microsoft Merger?

The one theme that I keep hearing from those who attended Citrix’s yearly conference (Synergy) is that they weren’t sure if they were at a Citrix conference or a Microsoft conference. Citrix’s ties to Microsoft run deep and have for a long time. But just within the past couple years the Citrix-MS relationship has started to look less like a partnership and more like a full-fledged integration. Microsoft has its own application virtualization product called App-V, which at first glance looks curiously like a competitor to Citrix’s XenApp application virtualization solution. Of course, since the technology is licensed from Citrix to begin with, Citrix profits regardless. Then there is the new group policy integration with XenApp policies that puts yet another nail in the coffin of the old Presentation Server console. All pretty innocuous changes.

But it’s not the technical changes that are really concerning. What has so many hardcore Citrix fans on edge is the appearance that Citrix is taking a backseat to Microsoft, and eventually will be swallowed up by them. Microsoft certainly has plenty of reason to merge with Citrix. Currently Microsoft pays licensing fees to Citrix for every terminal server license Microsoft sells. Now with App-V, Microsoft is paying even more. If you know anything about the history of MS-DOS, you know that this is not the Microsoft way. Sooner or later, Microsoft will seek to break free of its licensing obligations to Citrix, and the only way to do that is to buy them out.

But so what? This really didn’t concern me all that much at first, although I’d be very disappointed to see Citrix just become another division of Microsoft. The consequences of this didn’t really hit me until I was listening to the “Security Now” podcast with Steven Gibson and Leo Laporte on Laporte’s TWiT podcasting network. Citrix is a staple sponsor of the show, advertising their one-off remote access and collaboration services like GoToMeeting and GoToAssist. Gibson frequently (as in every episode) points out security vulnerabilities and poor security policies in Microsoft Windows, and his company’s website does not sugarcoat Microsoft’s past indiscretions. Putting myself in Microsoft’s shoes, I would imagine that they’d want to put the quash on Gibson’s comments. And if Microsoft buys out Citrix, they suddenly are in position to control the content of the show by threatening to pull sponsorship. And not just “Security Now” but other shows on the TWiT network as well. I believe TWiT could easily survive without sponsorship from Citrix, but it raises a difficult decision: Change the content to appease a sponsor, or sacrifice much-needed ad revenue for the integrity of the show?