Location: Articles

Articles

Articles

Non-scripting method for automated bulk-adding of AD users with SMTP mailbox address. Fast, simple

By on Wednesday, November 28, 2007 5:17 PM

Fast, simple mass creation of domain user objects with SMTP mailbox addresses using DSADD.

So you've set up your test AD environment and need to input a lot of users, and doing it automatically would be great. Would also be fabulous if you could tack on a matching SMTP email address and set a password, and maybe set a few other account options.


We've all seen and used the various VB scripts that create user accounts, some do it automatically using a variable for the username + number, others use data from a csv file or Excel spreadsheet. This is provided as an alternative method which uses DSADD from a command prompt.


Note that DSADD gives you visual feedback in the command prompt window as it is creating objects.


Using the below DSADD commands are as simple as copying the below snippets, paste into notepad, edit the domain name to your environment, then copy/paste into a command prompt window.
Using DSADD you can create accounts with expiring passwords, non-expiring passwords, expiring accounts, insert a matching SMTP address, assign a password, etc.

Note: Automatically adding the SMTP email address does not require MS Exchange. We're not 'mail enabling' the user object, just adding an SMTP address to the General tab of the user account properties.
This is particularly handy if you do not run Exchange or do not want to bother with installing Exchange Server in your test environment simply to test mail functionality of user accounts.
For example, you could set up the SMTP service and POP3 service in your test environment, and create simple POP mailboxes for the user accounts.

USE: open a command prompt on your test DC, edit the script to your environment variables and paste into the command prompt window, hit enter. If you are using the OU argument make sure that OU exists in your AD before running the script. Visit the link below for an explanation of options.

DSADD REFERENCE AND COMMAND LIST: http://technet2.microsoft.com/WindowsServer/en/library/8d37ecb0-ac28-4e05-aa05-da82dc36b54b1033.mspx?mfr=true 

// Bulk-add 200 users with SMTP address //

FOR /L %i in (1,1,200) DO dsadd user "cn=Test User%i,ou=PWD Expiring Users,dc=yourdomain,dc=net" -samid tuser%i -upn tuser%i@yourdomain.net -fn Test -ln User%i -display "Test User%i" -desc "password expiring user" -email tuser%i@yourdomain.net -office "Los Angeles" -dept "Corporate IT" -pwd Passw0rd123 -disabled no -acctexpires never -pwdneverexpires no

 

// Create single user with SMTP address //

dsadd user "cn=Test User,ou=PWD Expiring Users,dc=yourdomain,dc=net" -samid tuser -upn tuser@yourdomain.net -fn Test -ln User -display "Test User" -pwd Passw0rd123 -disabled no

 

Courtesy of SysOp Tools :: www.sysoptools.com


Rating
Comments
Currently, there are no comments. Be the first to post one!
Click here to post a comment
Friends

Friends

Namescape

Ads

Your Home Page ..

Site Articles:

Add to Google

Add to My Yahoo!

Mail List Posts:

Add to Google

Add to My Yahoo!

Friends

Friends

ScriptLogic
AdventNet Banner
Copyright 2008 ActiveDir.org
Terms Of Use