Benutzer:MovGP0/Powershell/DSC/Credentials

aus Wikipedia, der freien Enzyklopädie
   MovGP0        Über mich        Hilfen        Artikel        Weblinks        Literatur        Zitate        Notizen        Programmierung        MSCert        Physik      

Credentials

Credentials with Certificates

  • Securing pull server with SSL
  • Encrypt Credentials
  • Can use Active Directory PKI
  • Certificate is deployed in CERT:\LocalMachine\My
  • Export .cer file (public key) to client where the .mof file is created
    • use Export-Certificate
  • Configure VCM to use the certificate thumbprint using the CertificateID
ConfigurationData.psd1
$ConfigData = @{
    AllNodes = @{
        NodeName = "Server01"
        CertificateFile = "C:\Certificates\server01.cer"
        Thumbprint = "EBEA25C6D826D82C923EB2594CCCD6C1E46D5342"
    }
}
Configuration.ps1
Configuration MyConfiguration {
    Node "Server01" {
        User LocalAdmin {
            UserName = "LocalAdmin"
            Description = "Local administrator account"
            Disabled = $false
            Ensure = "Present"
            Password = $Credential
        }

        LocalConfigurationManager {
            CertificateID = "EBEA25C6D826D82C923EB2594CCCD6C1E46D5342"
            ConfigurationMode = "ApplyAndMonitor"
            ConfigurationModeFrequencyMins = 60
            RefreshMode="PUSH"
            RebootNodeIfNeeded = $true
        }
    }
}

Unencrypted Credentials for Test Environment

  • store Credentials unencrypted in .mof file
ConfigurationData.psd1
$ConfigData = @{
    AllNodes = @{
        NodeName = "*"
        PsDscAllowPlainTextPassword = $true
    }
}
Configuration.ps1
Configuration MyConfiguration {
    Node $Computername {
        User LocalAdmin {
            UserName = "LocalAdmin"
            Description = "Local administrator account"
            Disabled = $false
            Ensure = "Present"
            Password = $Password
        }
    }
}