Announcement

Collapse
No announcement yet.

Add Computers and modifying Users

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add Computers and modifying Users

    Hi,

    I have recently joined a 8000 user migration from NT4 to 2003.

    I am looking for ways to achieve the following using 2 excel spreadsheets to change the following in Active Directory.

    For Users
    1. Change the UPN to firstname.surname
    2. Change the pre-windows 2000 name to firstname.surname
    3. If the user exists, then add a number to the end of their name EG. Sean1
    3. Set the password to be the same for all users


    For Computers

    1. Create the computer accounts in departmental OUs and not the default Computers Container.

    I found this script from MS Script center for creating users, but I do not know how to change it to get it working for what I need.

    !-------------------------------------------------------------------------------------------------------
    Set objExcel = CreateObject("Excel.Application")
    Set objWorkbook = objExcel.Workbooks.Open _
    ("C:\Scripts\New_users.xls")
    intRow = 2
    Do Until objExcel.Cells(intRow,1).Value = ""
    Set objOU = GetObject("ou=Finance, dc=fabrikam, dc=com")
    Set objUser = objOU.Create _
    ("User", "cn=" & objExcel.Cells(intRow, 1).Value)
    objUser.sAMAccountName = objExcel.Cells(intRow, 2).Value
    objUser.GivenName = objExcel.Cells(intRow, 3).Value
    objUser.SN = objExcel.Cells(intRow, 4).Value
    objUser.AccountDisabled = FALSE
    objUser.SetInfo
    intRow = intRow + 1
    Loop
    objExcel.Quit
    !-------------------------------------------------------------------------------------------------------

    Can a similar script be created for the creating the computer account in a different OU, other than the default Computers Container

    Awaiting your responses,

    Regards,

    Sean

  • #2
    Re: Add Computers and modifying Users

    Update:

    I managed to reset all users in a specific OU by running..

    dsquery user ou=Users,ou=Migration,ou=Finance,dc=child,dc=paren t,dc=mydomain,dc=com -limit 0 | dsmod user -pwd [email protected]

    worked like a dream for 1749 users..

    Still looking for help on the others..

    Comment


    • #3
      Re: Add Computers and modifying Users

      The DS tools are great utilities for this kind of work and if you know how to script the parsing of .csv files you have a powerful and adaptable means to modify your AD attributes.

      You might also try ADModify which I found to be real handy for bulk modifications.

      http://www.microsoft.com/technet/pro...modifynet.mspx

      Comment


      • #4
        Re: Add Computers and modifying Users

        Originally posted by olson
        The DS tools are great utilities for this kind of work and if you know how to script the parsing of .csv files you have a powerful and adaptable means to modify your AD attributes.

        You might also try ADModify which I found to be real handy for bulk modifications.

        http://www.microsoft.com/technet/pro...modifynet.mspx
        Ill second that. VERY handy!
        Server 2000 MCP
        Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

        ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

        Comment

        Working...
        X