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 ...
-
11th September 2007, 02:18 PM #1
- Rep Power
- 14
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
-
-
IDG Tech News
-
11th September 2007, 02:23 PM #2 Re: Modifying user account information
Haven't used it in a while but you can mod stuff with AD infinitum
-
-
11th September 2007, 02:25 PM #3 Re: Modifying user account information
-
-
11th September 2007, 02:26 PM #4 Re: Modifying user account information
If you select all the users you want to edit right click > properties you can change the description box.
-
-
11th September 2007, 05:16 PM #5
- Rep Power
- 14
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.
-
-
11th September 2007, 10:06 PM #6 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
-
-
12th September 2007, 08:22 AM #7
- Rep Power
- 14
Re: Modifying user account information
That sounds more like it!
Ta
Mark
-
-
12th September 2007, 08:25 AM #8 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.
-
-
12th September 2007, 09:38 AM #9
- Rep Power
- 14
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!
-
-
12th September 2007, 09:43 AM #10 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.
-
-
12th September 2007, 10:18 AM #11
- Rep Power
- 14
Re: Modifying user account information
Thanks Iain!
Much Appreciated
-
-
12th September 2007, 10:57 AM #12
- Rep Power
- 14
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
-
-
12th September 2007, 11:16 AM #13 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
-
-
12th September 2007, 12:24 PM #14
- Rep Power
- 14
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!
-
-
12th September 2007, 12:31 PM #15 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:
Similar Threads
-
By timbo343 in forum Windows
Replies: 8
Last Post: 18th December 2007, 02:47 PM
-
By mark_sharman in forum Network and Classroom Management
Replies: 2
Last Post: 23rd February 2007, 10:38 PM
-
By Stese in forum Windows
Replies: 3
Last Post: 4th January 2007, 10:09 PM
-
By GrumbleDook in forum Windows
Replies: 4
Last Post: 23rd January 2006, 11: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
-
Forum Rules