Unable to Connect to PVS After PVS Server Upgrade or Downgrade

Unable to Connect to PVS After PVS Server Upgrade or Downgrade

book

Article ID: CTX226178

calendar_today

Updated On:

Description

After an upgrade of PVS from 7.13 to 7.15, or a downgrade of the PVS server from 7.13 to 7.6, the ELM was no longer able to connect to it.  Testing credentials would fail.  (Note, this probably happens in lots of other circumstances, but these are the two circumstances where we've seen this.)

If you look in the applayering.agent.log file you will see a log like this:

2017-07-24 10:32:09,808 ERROR 5 HandlerHelper: 'Application Error while processing 'Command' 'InvokePowerShellScriptCommand'': 'DefaultTitle="", MessageID="PowerShellSimpleError", {CategoryData={[PowerShellExceptionCategory { Command = "Add-PSSnapin -Name McliPSSnapIn; Mcli-Get Site -f siteId, siteName", Message = "Cannot load Windows PowerShell snap-in McliPSSnapIn because of the following error: The Windows PowerShell snap-in module C:\program files\citrix\provisioning services console\McliPSSnapIn.dll does not have the required Windows PowerShell snap-in strong name McliPSSnapIn, Version=7.6.3.9, Culture=neutral, PublicKeyToken=null.", ServerAddress = <null>, ExceptionType = "RemoteException" }]}'
2017-07-24 10:32:09,855 ERROR 5 HandlerHelper: Title: Error  Message: Cannot load Windows PowerShell snap-in McliPSSnapIn because of the following error: The Windows PowerShell snap-in module C:\program files\citrix\provisioning services console\McliPSSnapIn.dll does not have the required Windows PowerShell snap-in strong name McliPSSnapIn, Version=7.6.3.9, Culture=neutral, PublicKeyToken=null.  Details: 



The snap-in might be referencing either McliPSSnapIn.dll (earlier versions) or Citrix.PVS.Snapin.dll, and should reference the specific version (7.6.3.9 in this case).  If this line in any way is different from what it should be (7.6 instead of 7.13, or 7.13 instead of 7.15), then you might need to remove the incorrect versions from the registry and reregister the DLLs.

Resolution

The App Layering Agent will first try to run Citrix.PVS.Snapin, and will fail back to McliPSSnapin.  If you downgrade, then the registry entry for Citrix.PVS.Snapin will still exist even if the software does not.  In this case, it's sufficient to delete the snapin entry that does not still exist.

Deleted the registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Citrix.PVS.Snapin.

However, if you simply have a version mismatch (7.13 versus 7.15, for instance), then you will need to delete this registry key and then register the snapin DLL again manually.  We used https://developer-docs.citrix.com/projects/provisioning-services-powershell-object-programming-guide/en/latest/ as a reference.

To reregister the PVS snapin, run CMD As Administrator.
 
CD \Windows\Microsoft.NET\Framework64\v4.0.30319
.\InstallUtil.exe "C:\Program Files\Citrix\Provisioning Services Console\Citrix.PVS.Snapin.dll"
CD \Windows\Microsoft.NET\Framework\v4.0.30319
.\InstallUtil.exe "C:\Program Files\Citrix\Provisioning Services Console\Citrix.PVS.Snapin.dll"


Then you can verify that the registry key has been recreated with the correct version information.

Problem Cause

PVS server had been downgraded to 7.6.  The ELM was detecting the Citrix.PVS.Snapin was still installed on the PVS server but that snapin is only for the newer versions of PVS.

The ELM Unidesk PVC Connector log included the following snippets:
PVS Console found.  Located 'Citrix.PVS.SnapIn' at version '7.13.0.13008'
Cannot load Windows PowerShell snap-in Citrix.PVS.Snapin because of the following error: Could not load file or assembly 'file:///C:\\Program Files\\Citrix\\Provisioning Services Console\\Citrix.PVS.SnapIn.dll' or one of its dependencies. The system cannot find the file specified."