Solved

How to change First Name, Last Name and display name in AD Accounts

Posted on 2010-09-23
5
949 Views
Last Modified: 2012-05-10
We are trying to clean up our AD Accounts by adding First Names, Last Names as well as Display Names and I am looking for the most efficient way to automate this process.  Any suggestions would be greatly appreciated.

Thanks,
0
Comment
Question by:bob_kochanski
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:dhruvarajp
Comment Utility
0
 
LVL 10

Expert Comment

by:dhruvarajp
Comment Utility
you can use it for non exchange spedific attribues as well from the general tab
0
 
LVL 6

Accepted Solution

by:
Alan Gunn earned 250 total points
Comment Utility
Hi Bob!
If your users are currently using their Samid, windows 2000 style login names like "KochanskiB" you will presumably have a list of their first and last names.
There are a number of ways of inserting this info into AD.
The "DS" commands are tools for manipulating AD.
They require the distinguished name of an object in AD
This looks like
"CN=KochanskiB,CN=Users,DC=uk,DC=YourCompany,DC=com"
 To add Firstname, lastname and displayname to user account where the samid is known , you could use DSQuery to find the DN of the user and pipe the result using | (Shift \ on my keyboard) to DSMod.
dsquery user -samid KochanskiB | dsmod user -fn Bob -ln Kochakski -display "Bob Kochanski"
 To do this for lots of users, you could use Excel to "Build" the required commands.
See the attached Code snippet for the formula in E2
The commands can be highlighted and copied and pasted into a command prompt to execute.
 Hope this helps! :-)
 

="dsquery user -samid " & A2 & " | dsmod user -fn " & B2 & " -ln " & C2 & " -display " & """" & D2 & """"

Open in new window

addfirstlast.bmp
0
 
LVL 65

Expert Comment

by:RobSampson
Comment Utility
@ Tardis, that's not bad!  You could also use a macro to take those commands and put them in a batch file, which could then be executed.....then it would be a full solution.

Rob.
0
 
LVL 6

Expert Comment

by:Alan Gunn
Comment Utility
Thanks Rob! :-)
The good thing about re-inventing the wheel is that you don't HAVE to put the hole in the middle! :-)
 
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now