Debug GPO links;Fix typo
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2021-03-19 12:51:53 +01:00
parent a578ec5ae5
commit a0956209de
2 changed files with 5 additions and 2 deletions

View File

@ -41,7 +41,7 @@ If (@('primary','standalone') -contains $Parameter['deployment.type']) {
# Create new user # Create new user
$NewADUserSplat = @{ $NewADUserSplat = @{
Name = $UserName Name = $UserName
UserPrincipleName = "$($SanitizedUPN)@$((Get-ADDomain).DNSRoot)" UserPrincipalName = "$($SanitizedUPN)@$((Get-ADDomain).DNSRoot)"
Path = ($User.DistinguishedName -split ',', 2)[1] + (',{0}' -f (Get-ADRootDSE).rootDomainNamingContext) Path = ($User.DistinguishedName -split ',', 2)[1] + (',{0}' -f (Get-ADRootDSE).rootDomainNamingContext)
AccountPassword = ConvertTo-SecureString $User.Password -AsPlainText -Force AccountPassword = ConvertTo-SecureString $User.Password -AsPlainText -Force
PassThru = $True PassThru = $True

View File

@ -165,10 +165,13 @@ If (@('primary','standalone') -contains $Parameter['deployment.type']) {
$NewGPLinkSplat = @{ $NewGPLinkSplat = @{
Name = $NewGPO.DisplayName Name = $NewGPO.DisplayName
Target = $OU + ',DC=' + $Parameter['addsconfig.domainname'].Replace('.', ',DC=') Target = $OU + ',DC=' + $Parameter['addsconfig.domainname'].Replace('.', ',DC=')
ErrorAction = 'SilentlyContinue' # ErrorAction = 'SilentlyContinue'
} }
New-GPLink @NewGPLinkSplat | Out-Null New-GPLink @NewGPLinkSplat | Out-Null
} }
Else {
Throw "Path not accessible: 'AD:\$($OU + ',DC=' + $Parameter['addsconfig.domainname'].Replace('.', ',DC='))'"
}
} }
} }
} }