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 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 PowerShell. This topic describes how to do this plus additional tasks to help you use PowerShell.

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

For more information about using 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 Dynamics CRM PowerShell cmdlets

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

  2. Open a PowerShell command prompt.

  3. Enter the following command:

    Add-PSSnapin Microsoft.Crm.PowerShell
    

    This command adds the Dynamics CRM PowerShell snap-in to the current session. The snap-in is registered during installation and setup of the Microsoft Dynamics CRM server.

ImportantImportant
  • For information about registering the XRM tooling connector cmdlets, Get-CrmConnection and Get-CrmOrganizations, see MSDN: Use PowerShell cmdlets for XRM tooling to connect to CRM.

  • For information about registering the Package Deployer cmdlets, see Deploy packages using CRM Package Deployer and Windows PowerShell.

  • You must register the Dynamics CRM PowerShell commands, otherwise you’ll 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 cmdlet, use Get-HelpCRMCmdlet–full, such as the Import-CRMOrganization cmdlet.

Get-Help Import-CRMOrganization -full

Use the PowerShell cmdlets

Once you have registered the Dynamics CRM 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 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

Get Dynamics CRM PowerShell cmdlet Help topics

For a complete list of the Microsoft Dynamics CRM PowerShell cmdlets with links to Help topics, see the Microsoft Dynamics CRM PowerShell Reference.

Update deployment configuration settings using PowerShell

Use PowerShell to update deployment-wide settings, such as claims-based authentication, Internet-facing deployment (IFD), and web addresses. More information: Update deployment configuration settings

See Also

Send comments about this article to Microsoft.

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

Community Additions

ADD
Show:
© 2015 Microsoft