Export (0) Print
Expand All

Add a deployment administrator (PowerShell)

Dynamics CRM 2013

Applies To: Microsoft Dynamics CRM 2013, Microsoft Dynamics CRM Online

This sample code is for Microsoft Dynamics CRM 2013. Download the Microsoft Dynamics CRM SDK package. It can be found in the following location in the download package:

SampleCode\PS1\AddDeploymentAdministrator.ps1

Requirements

To set up the Microsoft Dynamics CRM PowerShell cmdlets, see Administer the deployment using Windows PowerShell.

Demonstrates

The following script will add a deployment administrator. You must specify the following parameters:

Name - A string that contains the name of the user to add as deployment administrator. The name must be in the format domain\username.

Example

param
(
    #required params
    [string]$Name = $(throw "Name parameter not specified")
)

$RemoveSnapInWhenDone = $False

if (-not (Get-PSSnapin -Name Microsoft.Crm.PowerShell -ErrorAction SilentlyContinue))
{
    Add-PSSnapin Microsoft.Crm.PowerShell
    $RemoveSnapInWhenDone = $True
}

New-CrmDeploymentAdministrator -Name $Name

if($RemoveSnapInWhenDone)
{
    Remove-PSSnapin Microsoft.Crm.PowerShell
}

See Also

Send comments about this article to Microsoft.

© 2014 Microsoft Corporation. All rights reserved.

Community Additions

Show:
© 2014 Microsoft