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