diff --git a/scripts/ADDS/payload/scripts/03.Users.ps1 b/scripts/ADDS/payload/scripts/03.Users.ps1 index f608cf6..adfe545 100644 --- a/scripts/ADDS/payload/scripts/03.Users.ps1 +++ b/scripts/ADDS/payload/scripts/03.Users.ps1 @@ -41,7 +41,7 @@ If (@('primary','standalone') -contains $Parameter['deployment.type']) { # Create new user $NewADUserSplat = @{ Name = $UserName - UserPrincipleName = "$($SanitizedUPN)@$((Get-ADDomain).DNSRoot)" + UserPrincipalName = "$($SanitizedUPN)@$((Get-ADDomain).DNSRoot)" Path = ($User.DistinguishedName -split ',', 2)[1] + (',{0}' -f (Get-ADRootDSE).rootDomainNamingContext) AccountPassword = ConvertTo-SecureString $User.Password -AsPlainText -Force PassThru = $True diff --git a/scripts/ADDS/payload/scripts/11.GPO+GPP.ps1 b/scripts/ADDS/payload/scripts/11.GPO+GPP.ps1 index f2dd17a..215404e 100644 --- a/scripts/ADDS/payload/scripts/11.GPO+GPP.ps1 +++ b/scripts/ADDS/payload/scripts/11.GPO+GPP.ps1 @@ -165,10 +165,13 @@ If (@('primary','standalone') -contains $Parameter['deployment.type']) { $NewGPLinkSplat = @{ Name = $NewGPO.DisplayName Target = $OU + ',DC=' + $Parameter['addsconfig.domainname'].Replace('.', ',DC=') - ErrorAction = 'SilentlyContinue' +# ErrorAction = 'SilentlyContinue' } New-GPLink @NewGPLinkSplat | Out-Null } + Else { + Throw "Path not accessible: 'AD:\$($OU + ',DC=' + $Parameter['addsconfig.domainname'].Replace('.', ',DC='))'" + } } } }