Solved

dsmod/dsadd Active Directory

Posted on 2006-07-10
3
1,594 Views
Last Modified: 2013-11-12
We want to easily create a large number of guest accounts with minimal interaction.  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"
0
Comment
Question by:ccunetwork
3 Comments
 
LVL 15

Accepted Solution

by:
lakshman_ce earned 125 total points
ID: 17076426
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explores the difference between two entities: List and Category.   In part one,  we'll look at the basic concepts, and set some groundwork.  In part two, we'll get to some conclusions. I know that these two things are different, but…
Introduction Many of the most common information processing tasks require sorting data sets.  For example, you may want to find the largest or smallest value in a collection.  Or you may want to order the data set in numeric or alphabetical order. …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now