Export (0) Print
Expand All

Administer the deployment using Windows PowerShell

Dynamics CRM 2013

Applies To: Microsoft Dynamics CRM 2013

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 configure Microsoft Dynamics CRM 2013 with Windows PowerShell. This topic describes how to do this and explains each of the supported commands. You can find all the organization database settings available in Get and set deployment configuration settings. For sample scripts, refer to the See Also links later in this topic.

Find help about the Windows PowerShell cmdlets for Microsoft Dynamics CRM at Microsoft Dynamics CRM PowerShell Reference.

For more information about Windows PowerShell, see Scripting with Windows PowerShell.

This release of the cmdlets includes the following improvements:

  • Remote execution of PowerShell scripts

  • Improved error reporting from cmdlets

  • Improved output from cmdlets

For more information about the programmatic use of the Deployment Web Service see “Administer the deployment using the deployment web service” in the Microsoft Dynamics CRM 2013 SDK.

  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.

  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

You must register the Microsoft Dynamics CRM Windows PowerShell commands, otherwise you will receive the following message when you try to run a cmdlet.

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

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

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. Examples are provided in the table below and in the following topics.

The following table lists the cmdlets available for use with Windows PowerShell.

 

Cmdlet

Description

Add-CrmServer

Adds a Microsoft Dynamics CRM server to the specified deployment.

Disable-CrmOrganization

Disables the specified Microsoft Dynamics CRM organization. For an example using this command, see Example – Disable or Enable an Organization.

Disable-CrmServer

Disables the specified Microsoft Dynamics CRM server.

Edit-CrmOrganization

Edits properties of the specified Microsoft Dynamics CRM organization. For an example using this command, see Example – Edit the Attributes of an Organization.

Enable-CrmOrganization

Enables the specified Microsoft Dynamics CRM organization. For an example using this command, see Example – Disable or Enable an 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. For a list of the settings objects, see Get and set deployment configuration settings.

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. For complete usage information, see Add a deployment administrator (PowerShell).

New-CrmOrganization

Initiates the process to create a new organization in the Microsoft Dynamics CRM deployment. For an example using this command, see Example – Create an Organization. For complete usage information, see Create an organization (PowerShell).

Remove-CrmCertificate

Removes the specified certificate from Microsoft Dynamics CRM.

Remove-CrmDeploymentAdministrator

Removes the specified deployment administrator from the Microsoft Dynamics CRM deployment. For complete usage information, see Delete a deployment administrator.

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. For a list of the settings objects, see Get and set deployment configuration settings.

Update-CrmOrganization

Updates the specified Microsoft Dynamics CRM organization with the latest software updates or upgrades the organization from Microsoft Dynamics CRM 2011 to Microsoft Dynamics CRM 2013.

See Also

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