jasongrubbs
IS-IT--Management
Hello, I have a unique question/issue.
We are flattening our domain from 1 parent and 2 child domains to 1 main domain and need to move our user accounts. We are utilizing the MoveTree command which is working fine.
When we try to move the accounts using movetree, we get an error about moving accounts that are bound to domain specific groups that are not universal (Domain Users). I found a couple different VB scripts to change the primary group for a user but I have not been able to find a utility to change the primary group for an entire OU.
Any easy way to accomplish this?
This is the code for the script to change one users primary group:
Set objUser = GetObject _
("LDAP://cn=alind,ou=Class of 2021,ou=LPG,dc=acad,dc=pgsd,dc=org")
Set objGroup = GetObject _
("LDAP://cn=Students,dc=acad,dc=pgsd,dc=org")
objGroup.GetInfoEx Array("primaryGroupToken"), 0
objUser.primaryGroupID = objGroup.primaryGroupToken
objUser.SetInfo
We are flattening our domain from 1 parent and 2 child domains to 1 main domain and need to move our user accounts. We are utilizing the MoveTree command which is working fine.
When we try to move the accounts using movetree, we get an error about moving accounts that are bound to domain specific groups that are not universal (Domain Users). I found a couple different VB scripts to change the primary group for a user but I have not been able to find a utility to change the primary group for an entire OU.
Any easy way to accomplish this?
This is the code for the script to change one users primary group:
Set objUser = GetObject _
("LDAP://cn=alind,ou=Class of 2021,ou=LPG,dc=acad,dc=pgsd,dc=org")
Set objGroup = GetObject _
("LDAP://cn=Students,dc=acad,dc=pgsd,dc=org")
objGroup.GetInfoEx Array("primaryGroupToken"), 0
objUser.primaryGroupID = objGroup.primaryGroupToken
objUser.SetInfo