Skip to content

CertificateImport

Daniel Scott-Raynsford edited this page Apr 26, 2018 · 7 revisions

CertificateImport

Parameters

Parameter Attribute DataType Description Allowed Values
Thumbprint Key string The thumbprint (unique identifier) of the certificate you're importing.
Path Required string The path to the CER file you want to import.
Location Key string The Windows Certificate Store Location to import the certificate to. LocalMachine, CurrentUser
Store Key string The Windows Certificate Store Name to import the certificate to.
Ensure Write string Specifies whether the certificate should be present or absent. Present, Absent

Description

The resource is used to import a certificate into a Windows certificate store.

Examples

Example 1

Import public key certificate into Trusted Root store.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String[]]
        $NodeName = 'localhost'
    )

    Import-DscResource -ModuleName CertificateDsc

    Node $AllNodes.NodeName
    {
        CertificateImport MyTrustedRoot
        {
            Thumbprint = 'c81b94933420221a7ac004a90242d8b1d3e5070d'
            Location   = 'LocalMachine'
            Store      = 'Root'
            Path       = '\\Server\Share\Certificates\MyTrustedRoot.cer'
        }
    }
}

Clone this wiki locally