Installing the Citrix Provisioning Services Console on XenApp
— Great How to by Jacques Bensimon:
First, why would you want to do that?
Well, besides the obvious ability to manage your Provisioning environment directly from your XenApp servers without having to remote into your PVS servers, installing the console also installs the PVS MCLI.exe command line tool and the MCLIPSSnapin PowerShell snap-in that provides a number of PVS-related cmdlets. This opens up the potential for all sorts of automation ideas, including a server assigning itself a different vDisk (under whatever circumstances you decide) and restarting itself to run that image. Let your imagination soar!
Okay then, what’s the issue?
The PVS console (MMC snap-in) wants to run under the .NET Framework v4.0, and takes steps via a .config file and a couple of Registry entries to force the use of that Framework both by the Microsoft Management Console mmc.exe (when it must load a .NET-based snap-in) and to some extent by other .NET assemblies installed on the machine, with unpredictable results. At the very least, it will cause an ugly error message when starting the XenApp console (I believe AppCenter is its name this week, at least in XA 6.5) because one of its components (the Single Sign-on piece) is designed to run under the .NET Framework v2.0, but that’s probably the least of the issues it could potentially cause with other consoles and apps.
So, is there a solution?
I’m insulted you’d even ask that question! J Here’s what you can do on your XenApp image:
1. Install the (x64) PVS console.
2. Copy mmc.exe and the (newly added) mmc.exe.config from %SystemRoot%\\system32\ to the installed PVS console folder.
3. Also copy "en-usmmc.exe.mui" from System32 to the same folder (in a new "en-us" folder).
4. *Delete* mmc.exe.config from System32!
5. *Delete* the (newly added) "OnlyUseLatestCLR" entries from "HKLM\Software\Microsoft\.NETFramework" *and* from the same Wow64\32\Node subkey!
6. Change the PVS console shortcut to explicitly specify the use of the "mmc.exe" copy in the installed PVS console folder.
1. To configure MCLI.exe for remote script execution (after installation of the PVS Console), run:
MCLI.exe run setupconnection -p server=pvs_server_name port=54321
This will create the following Registry entries:
2. To register the PVS PowerShell snap-in, run:
%SystemRoot%\Microsoft.NETFramework64v2.0.50727installutil.exe "%ProgramFiles%CitrixProvisioning Services ConsoleMcliPSSnapIn.dll"
To set up a connection to your PVS farm within PowerShell (to remotely execute all subsequent PVS cmdlets against the specified server), use the MCLI-Run cmdlet as follows:
MCLI-Run setupconnection -p server= pvs_server_name,port=54321
That’s it! (Note that all of the above applies equally to any non-PVS machine on which you wish to install the PVS console and execute remote PVS commands via either MCLI.exe or the equivalent PowerShell snap-in, not just to XenApp).