This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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='))'" | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user