Josha1138 0 Unverified User
We want to easily create a large number of guest accounts with minimal interaction.<br> Everything works good except one problem...
I don't want the guest to be part of Domain Users, which is added by default to new accounts, but I can't remove it with dsmod because it says Can't Remove the Primary Group. Is there some sort of code/script that I can add to this to basically change the primary group from Domain Users to Guest once the account is created?
 
FOR /L %i in (1,1,10) DO dsadd user "cn=CCU Guest%i,ou=Custom Object,dc=my,dc=domain,dc=edu" -samid CCUGuest%i -fn CCU -ln Guest%i -display "CCU Guest%i" -pwd g5%i2%i9 -disabled no -memberof "CN=Guest,CN=Users,DC=my,DC=domain,DC=edu" "CN=Domain Guests,CN=Users,DC=my,DC=domain,DC=edu"
 
dsmod group "CN=Domain Users,CN=Users,DC=my,DC=domain,DC=edu" -rmmbr "CN=CCU Guest1,OU=Custom Object,DC=my,DC=domain,DC=edu"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.