Solved

dsmod/dsadd Active Directory

Posted on 2006-07-10
3
1,597 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Fluent Interface Design Pattern You can use the Fluent Interface (http://en.wikipedia.org/wiki/Fluent_interface) design pattern to make your PHP code easier to read and maintain.  "Fluent Interface" is an object-oriented design pattern that r…
"Disruption" is the most feared word for C-level executives these days. They agonize over their industry being disturbed by another player - most likely by startups.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

776 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