Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DSmod question

Posted on 2009-04-14
4
Medium Priority
?
973 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 58

Assisted Solution

by:tigermatt
tigermatt earned 600 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 600 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 800 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A bad practice commonly found during an account life cycle is to set its password to an initial, insecure password. The Password Reset Tool was developed to make the password reset process easier and more secure.
Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

618 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