Tuesday, October 22, 2013

How to Registered\Unregister Microsoft Dynamics CRM PowerShell Snapin

We all know that Windows PowerShell 'cmdlets' can be used to perform CRM deployment and administration tasks. The cmdlets are installed on the computer when you install a Full Server Role or where you install the Deployment Tools Server Role, if you are installing individual server roles.

CRM 2013 provides remote execution of Windows PowerShell cmdlets. i.e. CRM Deployment and Administration tasks can be performed from the remote machine rather than login into the CRM Server(s).

While PowerShell cmdlets are executed via remote execution mode, its common that we receive "The term ‘Microsoft Dynamics CRM Windows PowerShell command' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again." error as Microsoft Dynamics CRM Windows PowerShell commands are not registered in the remote (from where the cmdlets) are executed.

We need to explicitly register 'Microsoft Dynamics CRM PowerShell Snapin' to perform any CRM related operation.

Below are the syntax to register & un-register snapin.

Register:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe "C:\Program Files\Microsoft Dynamics CRM\Tools\Microsoft.Crm.PowerShell.dll"

Un-Register:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /U "C:\Program Files\Microsoft Dynamics CRM\Tools\Microsoft.Crm.PowerShell.dll"


Note: C:\Program Files\Microsoft Dynamics CRM\Tools\ folder can be copied from CRM Server.

1 comment: