Writing a small vbs

Discussion in 'Software' started by Snipergod87, Feb 21, 2007.

  1. Snipergod87

    Snipergod87 Specialist

    Hey, i have to write a small vbc script for windows 2003 server enterprisee to Configure First, Last, Full and Display Names as well as Title, Department and Company for each user. and use the passwords provided. the MP_Users.txt is actually a .csv but i cant attach that kind of file so the extension needs to be changed. I am nto very familer with programming and i dont quite understand it i was wondering if i could get some pointers i know this script i downlaoded is not for my version of windows so it wont work. This is a project that is open everything so i figured maybe someone could give me some pointers here.. and the 712.txt is a .vbs just in txt for easy editing

    Peter C
     

    Attached Files:

  2. Mada_Milty

    Mada_Milty MajorGeek

    Is there anything more specific that you would like help with?

    Also, your script looks good to me. MS has made their code fairly standard. I would expect this to work on an AD domain... why is it that you think this won't work in Win2K3?

    Here's what I would do (if starting from scratch):

    1. If possible, I would work with the CSV in MS Excel. I've just always found it easier to work with. You can reference specific cells of information that way. Here's some sample showing how to open this in Excel:

    Code:
    Set o_excel = CreateObject ("Excel.Application")
    o_excel.visible = True
    Set o_workbooks = o_excel.workbooks
    Set o_source = o_workbooks.open (v_filepath)
    You can reference the Microsoft Excel Object Model at this link

    2. I would create an object bound explicitly to the OU you are creating your users in. Here's a sample of an LDAP query that does that:

    Code:
    Set o_office = GetObject("LDAP://OU=Users, OU=Office, OU=CGL, DC=corp, DC=cglmfg, DC=com")
    You can reference AD service interfaces at this link
     
  3. Snipergod87

    Snipergod87 Specialist

    Thanks for your reply, i managed to figure out the script and get done what i needed it to do, it was just a little time consuming
     
  4. Mada_Milty

    Mada_Milty MajorGeek

    Ahh good!

    What changes did you have to make to the original script?
    (for my own benefit, and that of other users with the same problem)
     
  5. Snipergod87

    Snipergod87 Specialist

    i got som help from a friend in writing it
     

    Attached Files:


MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds