Skip to content

Instantly share code, notes, and snippets.

@mgreenegit
Last active August 29, 2015 14:18
Show Gist options
  • Save mgreenegit/a2fae38e38607399e5e4 to your computer and use it in GitHub Desktop.
Save mgreenegit/a2fae38e38607399e5e4 to your computer and use it in GitHub Desktop.
Configuration to build a DC/CA
Configuration CA
{
param (
[Parameter(Mandatory=$true)]
[ValidateNotNullorEmpty()]
[PsCredential] $credential
)
Import-DSCResource -module xAdcsDeployment
Node 'localhost'
{
WindowsFeature ADCS-Cert-Authority
{
Ensure = 'Present'
Name = 'ADCS-Cert-Authority'
}
xADCSCertificationAuthority ADCS
{
Ensure = 'Present'
Credential = $credential
CAType = 'EnterpriseRootCA'
DependsOn = '[WindowsFeature]ADCS-Cert-Authority'
}
}
}
$configData = @{
AllNodes = @(
@{
NodeName = 'localhost';
PSDscAllowPlainTextPassword = $true
}
)
}
CA -ConfigurationData $configData -credential (get-credential) -OutputPath 'C:\CAConfig\'
Start-DscConfiguration -Wait -Force -Verbose -Path 'C:\CAConfig\'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment