blob: 44fc8d53e4ebb6767f79df78a81e499a90a77c02 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
param (
[string]$DomainName = "contoso.com"
)
$scriptName = $MyInvocation.MyCommand.Name
$logFile = "C:\$scriptName_log.txt"
Start-Transcript -Path $logFile -Append
Import-Module ADCSTemplate
Get-ChildItem -Path "C:\setup\templates" -Filter *.json | % {
$TemplateName = $_.BaseName
if (-not(Get-ADCSTemplate -DisplayName $TemplateName)) {
New-ADCSTemplate `
-DisplayName $TemplateName `
-JSON (Get-Content "C:\setup\templates\$_" -Raw) `
-Identity "$DomainName\Domain Users" `
-Publish
}
}
Stop-Transcript
|