Dear All!
I need a hint :)
I am creating a script that creates AD Users, creates HomeFolders with special security settings, sets their groups and creates an Mailbox (Exchange).
For users from different countries I need to use different Domain Controllers. This works, except of setting the primary group.
If I create the user on the logonserver of the server from which the script is executed it works, but not on others.
The part of the script I use for setting the primary group is:
"
$userP = Get-QADuser $login
$groupP = Get-QADGroup $mainGroupSec
$groupP | Add-QADGroupMember -Member $login
$userP | Set-QADUser -ObjectAttributes @{PrimaryGroupID=$groupP.PrimaryGroupToken} | Remove-QADGroupMember
"
Is there any way to set the server where to do this? Like f.e. Set-ADuser -server $DCServer?
Or is there a way to do this without using the Quest.ActiveRoles.ADManagementsnapin?
Thanks for any suggestion.
Best Regards,
Daniel