Administer the deployment using Windows PowerShell
Applies To: CRM 2015 on-prem
Windows PowerShell enables you to easily run deployment commands to change the configuration of your deployment, such as tasks that can be performed by using the Deployment Manager user interface. You can also use the methods that are described in the Microsoft Dynamics CRM SDK to perform these tasks. The Windows PowerShell cmdlets are installed on the computer when you install a Full Server role or when you install the Deployment Tools server role, if you’re installing individual server roles. To execute commands, you must first register the Microsoft Dynamics CRM commands with Windows PowerShell. This topic describes how to do this and provides a summary of several of the commands.
Find help about the Windows PowerShell cmdlets for Microsoft Dynamics CRM at CRM 2015 PowerShell Reference.
For more information about Windows PowerShell, see Scripting with Windows PowerShell.
For more information about the programmatic use of the Deployment Web Service see MSDN: Administer the deployment using the deployment web service.
Get started using the Microsoft Dynamics CRM PowerShell cmdlets
Log into the administrator account on your Microsoft Dynamics CRM server.
Open a Windows PowerShell command prompt.
In a Windows PowerShell window, enter the following command:
This command adds the Microsoft Dynamics CRM Windows PowerShell snap-in to the current session. The snap-in is registered during installation and setup of the Microsoft Dynamics CRM server.
|You must register the Microsoft Dynamics CRM Windows PowerShell commands, otherwise you will receive the following message when you try to run a cmdlet. 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.|
At the PowerShell prompt, type the following, replacing CrmCmdletName with the name of a command:
For detailed help for a specific a cmdlet, use Get-Help CRMCmdlet –full, such as the Import-CRMOrganization cmdlet.
Use the PowerShell cmdlets
Once you have registered the Microsoft Dynamics CRM Windows PowerShell commands, you can use them to perform tasks.
Use the following command to output the list of deployment administrators:
This command results in the following output:
Set properties using PowerShell cmdlets
Once you have registered the Microsoft Dynamics CRM Windows PowerShell commands, you can use them to perform tasks, such as set deployment-wide properties or set some organization properties.
For example, to add a Microsoft Dynamics CRM deployment administrator, run the following command where domain\adminName is the Active Directory domain and user name of the administrator that you want to add.
A list of some of the PowerShell cmdlets
The following table lists some of the cmdlets available for use with Windows PowerShell. For are more complete list, see CRM 2015 PowerShell Reference.
Adds a Microsoft Dynamics CRM server to the specified deployment.
Disables the specified Microsoft Dynamics CRM organization.
Disables the specified Microsoft Dynamics CRM server.
Edits properties of the specified Microsoft Dynamics CRM organization.
Enables the specified Microsoft Dynamics CRM organization.
Enables the specified Microsoft Dynamics CRM server.
Retrieves the server licensing and CAL licensing information for the deployment.
Gets an advanced setting value for Microsoft Dynamics CRM. In some cases, this cmdlet should only be used under the direction of Microsoft Support.
Retrieves the certificate information for Microsoft Dynamics CRM. The certificate object contains the public key of the service bus signing certificate.
Retrieves the deployment administrators for the Microsoft Dynamics CRM deployment.
Retrieves the license properties object for Microsoft Dynamics CRM.
Retrieves the status on asynchronous operations sitting in the asynchronous operation queue for Microsoft Dynamics CRM.
Retrieves one or all of the organizations in the deployment of Microsoft Dynamics CRM.
Retrieves a server object for one or all Microsoft Dynamics CRM servers in a deployment.
Retrieves a Microsoft Dynamics CRM deployment setting object.
Initiates the process to import a Microsoft Dynamics CRM organization database into the deployment.
Creates a new deployment administrator for the Microsoft Dynamics CRM deployment.
Initiates the process to create a new organization in the Microsoft Dynamics CRM deployment.
Removes the specified certificate from Microsoft Dynamics CRM.
Removes the specified deployment administrator from the Microsoft Dynamics CRM deployment.
Deletes the specified organization from the Microsoft Dynamics CRM deployment.
Deletes the specified server from the Microsoft Dynamics CRM deployment.
Sets an advanced setting value for Microsoft Dynamics CRM. This is for internal use only, unless under the direction of Microsoft Support.
Creates a certificate record or sets the properties of an existing certificate record in the Microsoft Dynamics CRM configuration database.
Sets the product key for the Microsoft Dynamics CRM deployment.
Sets the specified Microsoft Dynamics CRM deployment wide settings.
Updates the specified Microsoft Dynamics CRM organization database with the latest software updates or, where applicable, upgrades the organization to the next version.
Update deployment configuration settings using PowerShell
Use PowerShell to update deployment-wide settings, such as claims-based authentication, IFD, and web addresses. More information: Update deployment configuration settings
Send comments about this article to Microsoft.
© 2015 Microsoft. All rights reserved.