Set-CrmCertificate

Applies To: CRM 2015 on-prem

Set-CrmCertificate

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

Syntax

Parameter Set: WithoutStoreProperty
Set-CrmCertificate [-CertificateType] <String> [[-Name] <String> ] [-DataFile] <String> [-Credential <PSCredential> ] [-Diag] [-DwsServerUrl <String> ] [-Timeout <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: CertificateOnly
Set-CrmCertificate [-Certificate] <Certificate> [-Credential <PSCredential> ] [-Diag] [-DwsServerUrl <String> ] [-Timeout <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: WithStoreProperty
Set-CrmCertificate [-CertificateType] <String> [[-Name] <String> ] [-DataFile] <String> [-StoreName] <String> [-StoreLocation] <String> [-StoreFindType] <String> [-Credential <PSCredential> ] [-Diag] [-DwsServerUrl <String> ] [-Timeout <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

The Set-CrmCertificate cmdlet creates a certificate record or sets the properties of an existing certificate record in the Microsoft Dynamics CRM configuration database.

Parameters

-Certificate<Certificate>

Specifies a fully constructed certificate, created using Microsoft.Xrm.Sdk.Deployment.Certificate. This allows you to create a script to fully construct your certificate and pass it to the Set-CrmCertificate command with a single parameter.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-CertificateType<String>

Specifies the type of certificate to set. Currently AppFabricIssuer, TrustedIssuer, and RelyingPartyEncrypting are supported.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies the credentials used to log in to the Deployment web service.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DataFile<String>

Specifies the path to the x509 certificate. This path is used to load the certificate from a local file. This is generally a file with the .pfx extension.


Aliases

none

Required?

true

Position?

4

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Diag

Turns on stack traces for error reports returned from Microsoft Dynamics CRM service calls. Enabling this emits a detailed error message, including a stack trace, when an error is encountered by the CRM PowerShell command.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DwsServerUrl<String>

Identifies the location of the Deployment web service. This should be in the format: http://<serverurl> or https://<serverurl>, for example, http://contoso.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies the IssuerName of the certificate being set.


Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-StoreFindType<String>

Determines how the certificate should be located in the store. Currently FindBySubjectDistinguishedName is supported.


Aliases

none

Required?

true

Position?

6

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-StoreLocation<String>

Specifies the location to store this certificate. This will be either CurrentUser or LocalMachine.


Aliases

none

Required?

true

Position?

5

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-StoreName<String>

Specifies the name of the certificate store to store this certificate in. In general, this will be one of the following: AddressBook, CertificateAuthority, Disallowed, My, Root, TrustedPeople, or TrustedPublisher.


Aliases

none

Required?

true

Position?

4

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Timeout<Int32>

For internal use only.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

-------------------------- EXAMPLE 1 --------------------------

This example imports the specified certificate into Microsoft Dynamics CRM.


PS C:\> Set-CrmCertificate –DataFile E:\CERTTOLOAD.cer –StoreName “TrustedPublisher” –CertificateType “AppFabricIssuer” –StoreLocation “LocalMachine” –StoreFindType “FindBySubjectDistinguishedName”

 

Show: