Export (0) Print
Expand All

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 “Administer the deployment using the deployment web service” in the CRM Developer Center.

Get started using the Microsoft Dynamics CRM PowerShell cmdlets

  1. Log into the administrator account on your Microsoft Dynamics CRM server.

  2. Open a Windows PowerShell command prompt.

  3. In a Windows PowerShell window, enter the following command:

    Add-PSSnapin Microsoft.Crm.PowerShell
    

    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.

ImportantImportant
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.

  1. At the PowerShell prompt, type the following:

    Get-Help *Crm*
    

  1. At the PowerShell prompt, type the following, replacing CrmCmdletName with the name of a command:

    Get-Help CrmCmdletName
    

For detailed help for a specific a cmdlet, use Get-Help CRMCmdlet –full, such as the Import-CRMOrganization cmdlet.

Get-Help Import-CRMOrganization -full

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:

PS C:\Users\Administrator> Get-CrmDeploymentAdministrator

This command results in the following output:

 

Id

Name

ExtensionData

--

----

-------------

4f431656-90f8-e211-831c-00155da83c4f

myDomainName\Administrator

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.

New-DeploymentAdminstrator domain\adminName

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.

 

Cmdlet

Description

Add-CrmServer

Adds a Microsoft Dynamics CRM server to the specified deployment.

Disable-CrmOrganization

Disables the specified Microsoft Dynamics CRM organization.

Disable-CrmServer

Disables the specified Microsoft Dynamics CRM server.

Edit-CrmOrganization

Edits properties of the specified Microsoft Dynamics CRM organization.

Enable-CrmOrganization

Enables the specified Microsoft Dynamics CRM organization.

Enable-CrmServer

Enables the specified Microsoft Dynamics CRM server.

Get-CrmAccessLicense

Retrieves the server licensing and CAL licensing information for the deployment.

Get-AdvancedSetting

Gets an advanced setting value for Microsoft Dynamics CRM. In some cases, this cmdlet should only be used under the direction of Microsoft Support.

Get-CrmCertificate

Retrieves the certificate information for Microsoft Dynamics CRM. The certificate object contains the public key of the service bus signing certificate.

Get-CrmDeploymentAdministrator

Retrieves the deployment administrators for the Microsoft Dynamics CRM deployment.

Get-CrmLicenseProperty

Retrieves the license properties object for Microsoft Dynamics CRM.

Get-CrmOperationStatus

Retrieves the status on asynchronous operations sitting in the asynchronous operation queue for Microsoft Dynamics CRM.

Get-CrmOrganization

Retrieves one or all of the organizations in the deployment of Microsoft Dynamics CRM.

Get-CrmServer

Retrieves a server object for one or all Microsoft Dynamics CRM servers in a deployment.

Get-CrmSetting

Retrieves a Microsoft Dynamics CRM deployment setting object.

Import-CrmOrganization

Initiates the process to import a Microsoft Dynamics CRM organization database into the deployment.

New-CrmDeploymentAdministrator

Creates a new deployment administrator for the Microsoft Dynamics CRM deployment.

New-CrmOrganization

Initiates the process to create a new organization in the Microsoft Dynamics CRM deployment.

Remove-CrmCertificate

Removes the specified certificate from Microsoft Dynamics CRM.

Remove-CrmDeploymentAdministrator

Removes the specified deployment administrator from the Microsoft Dynamics CRM deployment.

Remove-CrmOrganization

Deletes the specified organization from the Microsoft Dynamics CRM deployment.

Remove-CrmServer

Deletes the specified server from the Microsoft Dynamics CRM deployment.

Set-CrmAdvancedSetting

Sets an advanced setting value for Microsoft Dynamics CRM. This is for internal use only, unless under the direction of Microsoft Support.

Set-CrmCertificate

Creates a certificate record or sets the properties of an existing certificate record in the Microsoft Dynamics CRM configuration database.

Set-CrmProductKey

Sets the product key for the Microsoft Dynamics CRM deployment.

Set-CrmSetting

Sets the specified Microsoft Dynamics CRM deployment wide settings.

Update-CrmOrganization

Updates the specified Microsoft Dynamics CRM organization database with the latest software updates or, where applicable, upgrades the organization to the next version.

See Also

Concepts

CRM 2015 PowerShell Reference
Operating Microsoft Dynamics CRM 2015

Send comments about this article to Microsoft.

© 2014 Microsoft Corporation. All rights reserved.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft