DSCResources/DSC_CertificateExport/en-US/about_CertificateExport.help.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
.NAME
    CertificateExport
 
.DESCRIPTION
    The resource is used to export a certificate from a Windows certificate
    store.
 
.PARAMETER Path
    Key - String
    The path to the file you that will contain the exported certificate.
 
.PARAMETER Thumbprint
    Write - String
    The thumbprint of the certificate to export. Certificate selector parameter.
 
.PARAMETER FriendlyName
    Write - String
    The friendly name of the certificate to export. Certificate selector parameter.
 
.PARAMETER Subject
    Write - String
    The subject of the certificate to export. Certificate selector parameter.
 
.PARAMETER DNSName
    Write - StringArray
    The subject alternative name of the certificate to export must contain these values. Certificate selector parameter.
 
.PARAMETER Issuer
    Write - String
    The issuer of the certificate to export. Certificate selector parameter.
 
.PARAMETER KeyUsage
    Write - StringArray
    The key usage of the certificate to export must contain these values. Certificate selector parameter.
 
.PARAMETER EnhancedKeyUsage
    Write - StringArray
    The enhanced key usage of the certificate to export must contain these values. Certificate selector parameter.
 
.PARAMETER Store
    Write - String
    The Windows Certificate Store Name to search for the certificate to export from. Certificate selector parameter. Defaults to 'My'.
 
.PARAMETER AllowExpired
    Write - Boolean
    Allow an expired certificate to be exported. Certificate selector parameter.
 
.PARAMETER MatchSource
    Write - Boolean
    Causes an existing exported certificate to be compared with the certificate identified for export and re-exported if it does not match.
 
.PARAMETER Type
    Write - String
    Allowed values: Cert, P7B, SST, PFX
    Specifies the type of certificate to export.
 
.PARAMETER ChainOption
    Write - String
    Allowed values: BuildChain, EndEntityCertOnly
    Specifies the options for building a chain when exporting a PFX certificate.
 
.PARAMETER Password
    Write - Instance
    Specifies the password used to protect an exported PFX file.
 
.PARAMETER ProtectTo
    Write - StringArray
    Specifies an array of strings for the username or group name that can access the private key of an exported PFX file without any password.
 
.PARAMETER IsExported
    Read - Boolean
    Returns true if the certificate file already exists and therefore has been exported.
 
.EXAMPLE 1
 
Exports a certificate as a CERT using the friendly name to identify it.
 
Configuration CertificateExport_CertByFriendlyName_Config
{
    Import-DscResource -ModuleName CertificateDsc
 
    Node localhost
    {
        CertificateExport SSLCert
        {
            Type = 'CERT'
            FriendlyName = 'Web Site SSL Certificate for www.contoso.com'
            Path = 'c:\sslcert.cer'
        }
    }
}
 
.EXAMPLE 2
 
Exports a certificate as a PFX using the friendly name to identify it.
 
Configuration CertificateExport_PfxByFriendlyName_Config
{
    param
    (
        [Parameter(Mandatory = $true)]
        [ValidateNotNullorEmpty()]
        [System.Management.Automation.PSCredential]
        $Credential
    )
 
    Import-DscResource -ModuleName CertificateDsc
 
    Node localhost
    {
        CertificateExport SSLCert
        {
            Type = 'PFX'
            FriendlyName = 'Web Site SSL Certificate for www.contoso.com'
            Path = 'c:\sslcert.cer'
            Password = $Credential
        }
    }
}