djameson Posted January 19, 2011 Posted January 19, 2011 First post here so bear with me. I apologize if this has been covered but my search found little helpful posts. Background: Recently moved from Novell Netware to Windows and AD. With Netware, I was able to write an Access file that pulled all users from eDir, compared it to our SIS, and spit out the student users that needed accounts. Then using ICE, I created all accounts. Quick, simple, painless. Currently using Win Server 2008R2 and Exchange 2010 Questions: How do you guys handle creating multiple accounts in AD? I can still pull AD users and compare....and get the list of students I need to create accounts for. I've used Ad Infinitum but it only does one context at a time. I've created a VBS script but can't seem to find the correct format for creating certain things (description, office, set password, and set account/password to not expire) and regardless, still have to manually create the home drive. Using any of the above, I have to create the Exchange mailbox manually also. Any advice or suggestions would be greatly appreciated. Thanks for your time.
ianh64 Posted January 20, 2011 Posted January 20, 2011 Hi I used a program to bulk load or children from an Excel spreadsheet created (then massaged) from our MIS system. Checkout the options at WiseSoft - Resources for IT Professionals . They are free with options to Donate. Worked fine in out 2008R2 system with Exchange 2010.
BatchFile Posted January 20, 2011 Posted January 20, 2011 (edited) edit: This is on Server 2003R2 - I don't see why it wouldn't work on 2008 though... /edit I export a list of users - here it's initials and their UPN (unique identification number), which I then use excel to calculate their username (which is their initials and a portion of the UPN). Put them all on one line with a "paste special" then save as a CSV. Open the CSV in notepad then put them in this batch file where indicated: 'Create users for %%a in (list,of,users,separated,by,commas) do dsadd user "CN=%%a,OU=ou2010,OU=ouPupils,OU=ouUsers,DC=cps,DC=local" -display %%a -hmdir \\cpsfilesrv1\users\pupils\ou2010\%%a -hmdrv z: -profile \\cpsfilesrv1\Profiles\pupils\ou09\%%a -loscr pupils2010.bat -pwd 123 -mustchpwd yes -disabled no 'Add them to groups for %%a in (list,of,users,separated,by,commas) do dsmod group "CN=Domain Users,CN=Users,DC=cps,DC=local" -addmbr "CN=%%a,OU=ou2010,OU=ouPupils,OU=ouUsers,DC=cps,DC=local" for %%a in (list,of,users,separated,by,commas) do dsmod group "CN=Grppupils2010,OU=ou2010,OU=ouPupils,OU=ouUsers,DC=cps,DC=local" -addmbr "CN=%%a,OU=ou2010,OU=ouPupils,OU=ouUsers,DC=cps,DC=local" Then run it on a DC. You could, of course do it all from the command prompt but with for loops that size I prefer to have the code handy just in case!! PS. Just be careful, those AD locations are, unusually for M$, CaSe SeNsItIve! (that took a bit of troubleshooting a while back I tell you:)) Edited January 20, 2011 by BatchFile
djameson Posted January 20, 2011 Author Posted January 20, 2011 Thanks for the input guys. I'll take a look at both suggestions here. Just in case you (or anyone is curious), I have the following VBScript running minus the couple of lines REM out. It pretty much is doing what I want at this point but always looking for better (translate easier!) ways of doing this: Set objExcel = CreateObject("Excel.Application") Set objWorkbook = objExcel.Workbooks.Open ("C:\Users\djameson\Desktop\ADAccounts\NewADUsers.xls") objExcel.Application.Visible = True intRow = 2 Do Until objExcel.Cells(intRow,1).Value = "" Set objOU = GetObject(objExcel.Cells(intRow,9).Value) Set objUser = objOU.Create ("User", "cn=" & objExcel.Cells(intRow, 2).Value) ObjUser.physicalDeliveryOfficeName = objExcel.Cells(intRow,3).Value objUser.LastName = objExcel.Cells(intRow,4).Value objUser.FirstName = objExcel.Cells(intRow,5).Value objUser.DisplayName = objExcel.Cells(intRow,6).Value objUser.sAMAccountName = objExcel.Cells(intRow,7).Value objUser.userPrincipalName = objExcel.Cells(intRow,7).Value objUser.description = objExcel.Cells(intRow,9).Value objUser.HomeDirectory = objExcel.Cells(intRow,11).Value objUser.HomeDrive = objExcel.Cells(intRow,12).Value objUser.userAccountControl = 512 objUser.SetInfo objUser.SetPassword objExcel.Cells(intRow,8).Value objUser.SetInfo ' objUser.Put "passwordNeverExpires", true ' objUser.SetInfo intRow = intRow + 1 Loop objExcel.Quit MsgBox " Users Created!!", ,"ACSD4 AD Usernames" Thanks again for your time.
TronXP Posted January 20, 2011 Posted January 20, 2011 When I moved from Novell to Windows 2008R2, I found this little program a great help in setting up users its AD Infinitum 2 AD Infinitum Active Directory network administration multiple user manager tool for Windows 2000 and NT4 It doesn't cost an awful lot and you can trial it.
chrisbrown Posted January 20, 2011 Posted January 20, 2011 Dear Everyone in this thread. PowerShell. That is all.
bio Posted January 21, 2011 Posted January 21, 2011 Agree with chrisbrown here... Powershell will do the trick just fine bio..
Firefox Posted January 21, 2011 Posted January 21, 2011 You should be able to also do this with a DSadd command, this should allow to to call on a file with the user names already entered SolutionBase: Using the Dsadd, Dsmod, Dsmove, and Dsrm Windows Server 2003 directory service command-line tools
chrisbrown Posted January 23, 2011 Posted January 23, 2011 You should be able to also do this with a DSadd command, this should allow to to call on a file with the user names already entered Sure, DSAdd will work, if you don't mind being stuck in the 90s.
Arthur Posted January 24, 2011 Posted January 24, 2011 PowerShell. That is all. Thirded. Don Jones has some excellent articles and videos on how to provision users in PowerShell... [b]Automate User Provisioning with Windows PowerShell[/b] [url="http://technet.microsoft.com/en-us/magazine/2009.03.windowspowershell.aspx"]Part 1[/url] ([url="http://technet.microsoft.com/en-us/edge/Video/ff944962"]Video[/url]), [url="http://technet.microsoft.com/en-us/magazine/2009.04.windowspowershell.aspx"]Part 2[/url] ([url="http://technet.microsoft.com/en-us/edge/Video/ff944970"]Video[/url]), [url="http://technet.microsoft.com/en-us/magazine/2009.05.powershell.aspx"]Part 3[/url], [url="http://technet.microsoft.com/en-us/magazine/2009.06.windowspowershell.aspx"]Part 4[/url]
mbyrew Posted January 24, 2011 Posted January 24, 2011 (edited) AD Infinitum does it for me. Plus it's really good for other AD actions like relocating 1200 Home Folder and TS-Home Folder details or identifying inactivate users by existing login names and last login date. Sure, purists will say that powershell will do this but AD Infinitum does not really need learning or require that you have a programmers orientated brain Edited January 24, 2011 by mbyrew
Firefox Posted January 24, 2011 Posted January 24, 2011 Sure, DSAdd will work, if you don't mind being stuck in the 90s. There is nothing wrong with the DS commands, probably why they are still part of the windows 2008 enterprise admin exam. Powershell is a great tool, but not very easy if you have no scripting background or an overview on the product. We use Primal Script with it's link into Powershell for a lot of our work, but simple AD queries DS still works just as easy and in seconds 1
chrisbrown Posted January 24, 2011 Posted January 24, 2011 There is nothing wrong with the DS commands, probably why they are still part of the windows 2008 enterprise admin exam. Powershell is a great tool, but not very easy if you have no scripting background or an overview on the product. We use Primal Script with it's link into Powershell for a lot of our work, but simple AD queries DS still works just as easy and in seconds I'm not debating that, but it's like writing a batch script or VBScript file. You just don't do it these days. Just like you don't go out and buy a 1990 model car because there's "nothing wrong with it". Try using DStools to reset the password of every user whose username ends with "aa" but is not in the "Admin" OU.
BatchFile Posted January 25, 2011 Posted January 25, 2011 I'm not debating that, but it's like writing a batch script or VBScript file. You just don't do it these days. Just like you don't go out and buy a 1990 model car because there's "nothing wrong with it". I've got one of those, too - a 1998 Suzuki Vitara - most of it built with bits from the original design in 1986:cool: It gets me to work and back whatever the weather (untreated roads around here), does the job and I know how it works. It costs pennies to fix because I can get at everything with a socket set, most of it (including an oil change) from under the bonnet - there's that much space!). The point: Like my vitara, DsAdd etc work for me. I understand it, and when I keep the batchfiles I can see what I did if I screw up. In much the same way that I don't need a device to buzz my backside when I cross the white line without the indicator on, I've never needed to "to reset the password of every user whose username ends with "aa" but is not in the "Admin" OU." when I do, you'll probably find a thread on here with me asking how to use powershell
chrisbrown Posted January 25, 2011 Posted January 25, 2011 I've got one of those, too - a 1998 Suzuki Vitara - most of it built with bits from the original design in 1986:cool: It gets me to work and back whatever the weather (untreated roads around here), does the job and I know how it works. It costs pennies to fix because I can get at everything with a socket set, most of it (including an oil change) from under the bonnet - there's that much space!). Okay...I said you don't go buy one. Not you don't keep your old one. If your old scripts work fine, use them. It's not my environment, I don't care what you use. However, for a *new* scripter wanting to learn to do things..there is no point recommending he/she use an archaic technology, like there's no point telling him/her that he/she should buy a 1990 automobile. The point: Like my vitara, DsAdd etc work for me. I understand it, and when I keep the batchfiles I can see what I did if I screw up. In much the same way that I don't need a device to buzz my backside when I cross the white line without the indicator on, I've never needed to "to reset the password of every user whose username ends with "aa" but is not in the "Admin" OU." when I do, you'll probably find a thread on here with me asking how to use powershell And when you do...I'll be ready. I had to do this very thing on Friday, hence it being fresh in my mind.
djameson Posted January 25, 2011 Author Posted January 25, 2011 Thanks for all the suggestions and comments. I'll take a look at PowerShell as it appears (from looking at some examples) that it is a combination of some of the things I am using now with some new features. Arthur, thanks for the links. Almost exactly what I want/need to do. Thanks again.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now