Compartilhar via


Set-CrmCertificate

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

Syntax

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

Description

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

Examples

Example 1

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

Imports the specified certificate into the Dynamics 365 deployment.

Parameters

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

Type:Certificate
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-CertificateType

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

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

Expects a variable that contains the user credentials used for signing in to Dynamics 365 on-premises organization. To establish this variable, run the PowerShell command $Cred = Get-Credential.

Type:PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DataFile

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.

Type:String
Position:3
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Diag

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DwsServerUrl

The URL of the Deployment Web Service. This should be in the format: https://, for example, https://contoso.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the IssuerName of the certificate being set.

Type:String
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-StoreFindType

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

Type:String
Position:5
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-StoreLocation

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

Type:String
Position:4
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-StoreName

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.

Type:String
Position:3
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Timeout

For internal use only.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

Microsoft.Xrm.Sdk.Deployment.Certificate System.Int32 System.Management.Automation.SwitchParameter System.Management.Automation.PSCredential

Outputs

System.Object