From a0956209deaa6bbd797aca7bd92e9a98682c9820 Mon Sep 17 00:00:00 2001 From: djpbessems Date: Fri, 19 Mar 2021 12:51:53 +0100 Subject: [PATCH] Debug GPO links;Fix typo --- scripts/ADDS/payload/scripts/03.Users.ps1 | 2 +- scripts/ADDS/payload/scripts/11.GPO+GPP.ps1 | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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='))'" + } } } }