+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 24
Windows Thread, Modifying user account information in Technical; Hi! I am new to this forum, but have been reading with keen interest lately! I am trying to do ...
  1. #1

    Join Date
    Sep 2005
    Posts
    153
    Thank Post
    1
    Thanked 4 Times in 4 Posts
    Rep Power
    18

    Modifying user account information

    Hi!

    I am new to this forum, but have been reading with keen interest lately!
    I am trying to do some thing I think is fairly simpe in active directory. I have added a load of bulk users in active directory, but I would like to add the users display name, to the users description, so it appears in the user list.

    I have looked at dsmod user for this, but cant find any examples allowing me to do what i want to do!

    Has anyone done this before, or got any ideas?

    Ta
    Mark

  2. #2
    iatkinson's Avatar
    Join Date
    Jun 2007
    Location
    Blackburn
    Posts
    135
    Thank Post
    5
    Thanked 6 Times in 5 Posts
    Rep Power
    16

    Re: Modifying user account information

    Haven't used it in a while but you can mod stuff with AD infinitum

  3. #3

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,802
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Modifying user account information


  4. #4

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,758
    Thank Post
    825
    Thanked 1,662 Times in 1,447 Posts
    Blog Entries
    11
    Rep Power
    441

    Re: Modifying user account information

    If you select all the users you want to edit right click > properties you can change the description box.

  5. #5

    Join Date
    Sep 2005
    Posts
    153
    Thank Post
    1
    Thanked 4 Times in 4 Posts
    Rep Power
    18

    Re: Modifying user account information

    Yes, but that means I can only update all users with the same description!!

    I want to match individual users display name to the description, then move onto the next user.

    P.S. I have 300+ users to do this for!!

    Kind regards
    Mark.

  6. #6

    Join Date
    Jul 2005
    Location
    Rugby
    Posts
    432
    Thank Post
    17
    Thanked 66 Times in 61 Posts
    Rep Power
    35

    Re: Modifying user account information

    Mark, you'll want to use a tool called ADModify.net
    It will let you select an OU full of users and fill the description field with the required data.

    Matt

  7. #7

    Join Date
    Sep 2005
    Posts
    153
    Thank Post
    1
    Thanked 4 Times in 4 Posts
    Rep Power
    18

    Re: Modifying user account information

    That sounds more like it!

    Ta
    Mark

  8. #8
    Iain's Avatar
    Join Date
    Oct 2006
    Location
    Warwickshire
    Posts
    184
    Thank Post
    28
    Thanked 91 Times in 51 Posts
    Rep Power
    31

    Re: Modifying user account information

    Or use a very simple vbs script. e.g.

    Code:
    Set objRootDSE = GetObject("LDAP://rootDSE")
    
    ' Define the Distinguished Name of the Organizational Unit
    ' containing the users to modify
    strUserOU = "ou=Students," & objRootDSE.Get("defaultNamingContext")
    
    ' Bind to the users OU
    Set objOU = GetObject ("LDAP://" & strUserOU)
    
    ' Set the filter to only return user objects
    objOU.Filter = Array("user")
    
    ' Iterate through the user objects setting the required 
    ' attributes
    For each objUser in objOU
    	' Get the user's display name
    	strDisplayName = objUser.displayName
    	' Set the user's discription = user's display name
    	objUser.Description = strDisplayName
    	objUser.SetInfo
    Next
    
    ' Clean up
    Set objOU = Nothing
    Set objRootDSE = Nothing
    Iain.

  9. #9

    Join Date
    Sep 2005
    Posts
    153
    Thank Post
    1
    Thanked 4 Times in 4 Posts
    Rep Power
    18

    Re: Modifying user account information

    How can I run this script?
    Can I create a batch file that points to the vb file, or do I need to do somethign in particular!

    Thanks for all the help by the way, although I havent managed to get any of the solutions working so far, but this script looks okay!

    Just need to get it working now!

  10. #10
    Iain's Avatar
    Join Date
    Oct 2006
    Location
    Warwickshire
    Posts
    184
    Thank Post
    28
    Thanked 91 Times in 51 Posts
    Rep Power
    31

    Re: Modifying user account information

    Just save the script in a file with a name of your choice and give it a .vbs extension.

    Then at the command prompt, go to the directory where you have saved the script and type <scriptname>.vbs and it should run.

    Don't forget to modify the strUserOU variable to point the the OU where you have created the users.

    Iain.

  11. #11

    Join Date
    Sep 2005
    Posts
    153
    Thank Post
    1
    Thanked 4 Times in 4 Posts
    Rep Power
    18

    Re: Modifying user account information

    Thanks Iain!

    Much Appreciated

  12. #12

    Join Date
    Sep 2005
    Posts
    153
    Thank Post
    1
    Thanked 4 Times in 4 Posts
    Rep Power
    18

    Re: Modifying user account information

    Tried running the script but it came up with an error concerning the objRootLDAP, which it says is required!, not too sure on how to fix this!

    Mark

  13. #13
    Iain's Avatar
    Join Date
    Oct 2006
    Location
    Warwickshire
    Posts
    184
    Thank Post
    28
    Thanked 91 Times in 51 Posts
    Rep Power
    31

    Re: Modifying user account information

    Appologies a mistake on my part, I used the wrong variable name on the line

    Code:
    strUserOU = "ou=Students," & objRootLDAP.Get("defaultNamingContext")
    it should read:

    Code:
    strUserOU = "ou=Students," & objRootDSE.Get("defaultNamingContext")
    Iain

  14. #14

    Join Date
    Sep 2005
    Posts
    153
    Thank Post
    1
    Thanked 4 Times in 4 Posts
    Rep Power
    18

    Re: Modifying user account information

    Still no luck, now it says that the object (scriptname).vbs, doesnt exist, and I have checked the file name more than once!

    Mark

    aarrrrggghhhh!

  15. #15
    Iain's Avatar
    Join Date
    Oct 2006
    Location
    Warwickshire
    Posts
    184
    Thank Post
    28
    Thanked 91 Times in 51 Posts
    Rep Power
    31

    Re: Modifying user account information

    Is the error There is no such object on the server.? If so it means you have not defined strUserOU correctly.

    Iain.

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

Similar Threads

  1. Deleted Admin User Account
    By timbo343 in forum Windows
    Replies: 8
    Last Post: 18th December 2007, 01:47 PM
  2. Mandatory profile gets deleted along with the user account
    By mark_sharman in forum Network and Classroom Management
    Replies: 2
    Last Post: 23rd February 2007, 09:38 PM
  3. Replies: 3
    Last Post: 4th January 2007, 09:09 PM
  4. Modifying a mandatory profile - printers
    By GrumbleDook in forum Windows
    Replies: 4
    Last Post: 23rd January 2006, 10:54 AM

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
  •