Examples/Resources/WSManListener/5-WSManListener_HTTPS_WithThumbprintAndHostname.ps1

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
<#
    .EXAMPLE
        Create an HTTPS Listener using a LocalMachine certificate with a thumbprint
        matching 'F2BE91E92AF040EF116E1CDC91D75C22F47D7BD6'. If the subject in the
        certificate does not match the name of the host then the Hostname parameter
        must be specified. In this example the subject in the certificate is
        'WsManListenerCert'.
#>

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

    Import-DscResource -Module WSManDsc

    Node $NodeName
    {
        WSManListener HTTPS
        {
            Transport             = 'HTTPS'
            Ensure                = 'Present'
            CertificateThumbprint = 'F2BE91E92AF040EF116E1CDC91D75C22F47D7BD6'
            Hostname              = 'WsManListenerCert'
        } # End of WSManListener Resource
    } # End of Node
} # End of Configuration