+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
Windows Server 2008 R2 Thread, Creating Multiple Accounts in Technical; First post here so bear with me. I apologize if this has been covered but my search found little helpful ...
  1. #1

    Join Date
    Jan 2011
    Location
    Anderson
    Posts
    35
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Creating Multiple Accounts

    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.

  2. #2

    Join Date
    Mar 2010
    Location
    Surrey, UK
    Posts
    120
    Thank Post
    20
    Thanked 3 Times in 3 Posts
    Rep Power
    10
    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.

  3. #3
    BatchFile's Avatar
    Join Date
    Aug 2007
    Location
    Cumbria
    Posts
    963
    Thank Post
    550
    Thanked 129 Times in 107 Posts
    Rep Power
    60
    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:
    Code:
    '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)
    Last edited by BatchFile; 20th January 2011 at 10:24 AM.

  4. #4

    Join Date
    Jan 2011
    Location
    Anderson
    Posts
    35
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

  5. #5

    Join Date
    Oct 2007
    Location
    Newcastle Upon Tyne
    Posts
    466
    Thank Post
    153
    Thanked 68 Times in 59 Posts
    Rep Power
    44
    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.

  6. #6
    chrisbrown's Avatar
    Join Date
    Aug 2010
    Location
    Melbourne, Australia
    Posts
    103
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    17
    Dear Everyone in this thread.

    PowerShell. That is all.

  7. #7
    bio
    bio is offline
    bio's Avatar
    Join Date
    Apr 2008
    Location
    netherlands
    Posts
    520
    Thank Post
    16
    Thanked 130 Times in 102 Posts
    Rep Power
    38
    Agree with chrisbrown here... Powershell will do the trick just fine

    bio..

  8. #8

    Join Date
    Dec 2009
    Posts
    276
    Thank Post
    6
    Thanked 35 Times in 33 Posts
    Rep Power
    16
    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

  9. #9
    chrisbrown's Avatar
    Join Date
    Aug 2010
    Location
    Melbourne, Australia
    Posts
    103
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    17
    Quote Originally Posted by Firefox View Post
    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.

  10. #10


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,793
    Thank Post
    262
    Thanked 2,964 Times in 2,179 Posts
    Rep Power
    846
    Quote Originally Posted by chrisbrown View Post
    PowerShell. That is all.
    Thirded. Don Jones has some excellent articles and videos on how to provision users in PowerShell...

    Code:
    Automate User Provisioning with Windows PowerShell
    Part 1 (Video), Part 2 (Video), Part 3, Part 4

  11. #11

    Join Date
    Apr 2007
    Location
    Peterborough
    Posts
    55
    Thank Post
    2
    Thanked 9 Times in 5 Posts
    Rep Power
    17
    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
    Last edited by mbyrew; 24th January 2011 at 08:46 AM.

  12. #12

    Join Date
    Dec 2009
    Posts
    276
    Thank Post
    6
    Thanked 35 Times in 33 Posts
    Rep Power
    16
    Quote Originally Posted by chrisbrown View Post
    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

  13. Thanks to Firefox from:

    BatchFile (24th January 2011)

  14. #13
    chrisbrown's Avatar
    Join Date
    Aug 2010
    Location
    Melbourne, Australia
    Posts
    103
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    17
    Quote Originally Posted by Firefox View Post
    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.

  15. #14
    BatchFile's Avatar
    Join Date
    Aug 2007
    Location
    Cumbria
    Posts
    963
    Thank Post
    550
    Thanked 129 Times in 107 Posts
    Rep Power
    60
    Quote Originally Posted by chrisbrown View Post
    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 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(tm) 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

  16. #15
    chrisbrown's Avatar
    Join Date
    Aug 2010
    Location
    Melbourne, Australia
    Posts
    103
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    17
    Quote Originally Posted by BatchFile View Post
    I've got one of those, too - a 1998 Suzuki Vitara - most of it built with bits from the original design in 1986 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.

    Quote Originally Posted by BatchFile View Post
    The point: Like my vitara, DsAdd etc work for me. I understand it, and when I keep the batchfiles(tm) 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.



SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Multiple email accounts with OWA
    By AnnDroyd in forum Windows Server 2000/2003
    Replies: 15
    Last Post: 14th October 2010, 10:38 AM
  2. Zimbra - Creating accounts
    By Tricky_Dicky in forum *nix
    Replies: 0
    Last Post: 20th July 2010, 02:48 PM
  3. Multiple Skype accounts
    By steve_nfi in forum How do you do....it?
    Replies: 5
    Last Post: 29th January 2008, 10:54 AM
  4. Replies: 25
    Last Post: 23rd November 2007, 09:24 AM
  5. Editing multiple user accounts
    By Andie in forum Windows
    Replies: 5
    Last Post: 27th April 2007, 03:30 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •