Solved

DSmod question

Posted on 2009-04-14
4
962 Views
Last Modified: 2012-08-14
I need to change the displayname attribute of every user in my active directory structure.  I was going to us dsquery and pipe the results to dsmod, but I need to know if I can use active directory attributes to define what I want changed.  For instance I was thinking:

dsquery user "ou=my ou,dc=mycompany,dc=com" | dsmod user -display lastname & firstname

but obviously I don't know how to pull the attributes for the firstname and lastname in ad.  Does anybody know?
0
Comment
Question by:DustinHinkel
4 Comments
 
LVL 58

Assisted Solution

by:tigermatt
tigermatt earned 150 total points
ID: 24140487

Rather than script it, I'd suggest you use ADModify.NET. This is a tool for bulk modifying Active Directory objects, and you can obtain it from http://www.codeplex.com/admodify.

In the tool, having set the scope of the changes you need to make and selecting the user accounts, you'd check the Display Name option and enter %'sn'%, %'givenName'% in order to set it as Last Name, First Name for all the objects you selected. sn and givenName are actual Active Directory attribute names for last name and first name.

-Matt
0
 
LVL 6

Assisted Solution

by:ngailfus
ngailfus earned 150 total points
ID: 24140498
We use ADModify to perform bulk changes to accounts.  One of the built in options is to change everyone to lastname, firstname.

http://www.codeplex.com/admodify

0
 
LVL 57

Accepted Solution

by:
Mike Kline earned 200 total points
ID: 24141182
Excellent suggestion by Matt as usual, admodify is great. (and you can undo changes if you make a mistake using admodify)
Another way to do it via the command line is to use adfind and admod by MVP Joe Richards
I wrote a blog entry on that here:
http://adisfun.blogspot.com/2009/04/modify-user-displayname-using-command.html
Thanks
Mike
0
 

Author Comment

by:DustinHinkel
ID: 24142954
Thanks for the suggestions guys.  In the meantime I found and edited a vbs script.  I attached the code in case anybody was curious.  It's pretty simple.  I'll distribute points.
set objparent = GetObject("LDAP://ou=people,dc=mydomain,dc=com")
objparent.Filter = Array("user")
for each objUser in objparent
objuser.displayname = objuser.get("sn") & ", " & objuser.get("givenname")
objuser.setinfo
next

Open in new window

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question