Examples/Resources/cWebManagementService/1-SetManagementCertificate.ps1

<#
    .EXAMPLE
    Request and Accept a certificate from an Active Directory Root Certificate Authority. Then assign it to
    the IIS Web Management Service
#>

configuration Example
{
    param
    (
        [Parameter()]
        [string[]]
        $NodeName = 'localhost',

        [Parameter(Mandatory = $true)]
        [ValidateNotNullorEmpty()]
        [PSCredential]
        $Credential
    )

    Import-DscResource -ModuleName xCertificate
    Node 'localhost'
    {
        xCertReq SSLCert
        {
            CARootName                = 'test-dc01-ca'
            CAServerFQDN              = 'dc01.test.pha'
            Subject                   = 'foodomain.test.net'
            KeyLength                 = '1024'
            Exportable                = $true
            ProviderName              = '"Microsoft RSA SChannel Cryptographic Provider"'
            OID                       = '1.3.6.1.5.5.7.3.1'
            KeyUsage                  = '0xa0'
            CertificateTemplate       = 'WebServer'
            AutoRenew                 = $true
            Credential                = $Credential
        }

        cWebManagementService WebManager {
            CertificateSubjectName = $Node.Subject
            EnableRemoteManagement = 1
            DependsOn = @('[xCertReq]SSLCert')
        }

    }
}