Add-CertificateEnrollmentPolicyServer
Adds an enrollment policy server to the current user or local system configuration.
Syntax
Add-CertificateEnrollmentPolicyServer
[-NoClobber]
-Url <Uri>
[-RequireStrongValidation]
[-Credential <PkiCredential>]
-context <Context>
[-AutoEnrollmentEnabled]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Add-CertificateEnrollmentPolicyServer
cmdlet adds an enrollment policy server to the current
user or local system configuration. If an enrollment policy server already exists, then this cmdlet
will overwrite it. Group Policy can be configured to prevent enrollment policy servers from being
added.
Delegation may be required when using this cmdlet with Windows PowerShell remoting and changing user configuration.
Examples
EXAMPLE 1
Add-CertificateEnrollmentPolicyServer -Url $url -Context Machine
This example loads a policy from $url
using Windows integrated authentication under the computer
context, using the computer account credentials. This example also adds the policy server to the
local computer configuration. Auto enrollment is off and strong validation is off.
EXAMPLE 2
$cert = Get-ChildItem -Path cert:\LocalMachine\My\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF
$parameters = @{
Url = $cert.EnrollmentPolicyEndPoint.Url
Credential = $cert
Context = 'Machine'
}
Add-CertificateEnrollmentPolicyServer @parameters
This example loads a policy using $cert
as the authentication credential and adds the policy to
the local computer local configuration since the context is the local computer (Machine).
EXAMPLE 3
$up = Get-Credential
Add-CertificateEnrollmentPolicyServer -Url $url -Context Machine -Credential $up
This example loads a policy using the username and password from $url
.
This example adds the policy server to the local computer configuration.
EXAMPLE 4
$cert = Get-ChildItem -Path cert:\CurrentUser\My\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF
$parameters = @{
Url = $cert.EnrollmentPolicyEnd
Credential = $cert.PSPath
Context = 'Machine'
}
Add-CertificateEnrollmentPolicyServer @parameters
This example loads policy using the Path object for a certificate. Use the certificate to authenticate to the URL and add the policy server into the local user configuration.
EXAMPLE 5
$up = Get-Credential
Add-CertificateEnrollmentPolicyServer -Url $url -Context User -Credential $up -WhatIf
What if: Policy successfully loaded from {$url} using username/password credentials.
Policy server configuration will be added to current user context.
This example shows that if the policy cannot be loaded or if there is a conflict with an identifier (ID) or URL, then this will be the output.
If the policy server already exists, then the output will state that the existing policy server configuration will be overwritten.
Parameters
-AutoEnrollmentEnabled
Enables auto-enrollment for the policy server being added.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
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: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Context
Stores information about the policy server in the configuration for the Current User or Local computer.
Type: | Microsoft.CertificateServices.Commands.Context |
Accepted values: | Machine, User |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Credential
Specifies the credential used to authenticate to the policy server. This credential can be a PSCredential object, which is a username and password, an x509 certificate, or a path to an x509 certificate. Kerberos authentication is used if no credential is specified.
Type: | Microsoft.CertificateServices.Commands.PkiCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NoClobber
Prevents an enrollment policy server from overwriting an existing one.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RequireStrongValidation
Specifies that the certificate obtained through this enrollment policy server must be trusted on the client.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Url
Identifies the uniform resource locator (URL) of the enrollment policy server to configure.
Type: | Uri |
Position: | Named |
Default value: | None |
Required: | True |
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: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.CertificateServices.Commands.EnrollmentPolicyServer
The EnrollmentPolicyServer object contains information about the certificate enrollment policy.
Outputs
Microsoft.CertificateServices.Commands.EnrollmentPolicyServer
The EnrollmentPolicyServer object contains information about the certificate enrollment policy.