Solved

dsmod/dsadd Active Directory

Posted on 2006-07-10
3
1,609 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
lakshman_ce earned 125 total points
ID: 17076426
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

The CRUD Functions CRUD, meaning "Create, Read, Update, Delete (http://en.wikipedia.org/wiki/Create,_read,_update_and_delete)" is a common term to data base developers.  It describes the essential functions of data base table maintenance.  This art…
Dependencies in Software Design In software development, the idea of dependencies (http://en.wikipedia.org/wiki/Coupling_%28computer_programming%29) is an issue of some importance. This article seeks to explain what dependencies are and where they …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

617 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