Exchange Geek's Weblog

I'm a Geek!

How to add Employee Numbers in ADUC and Exchange GAL

Posted by Milind Naphade on 06/05/2010

Some companies need to use AD to store their Employee Numbers or Employee IDs but due to limitations in ADUC MMC most of the people don’t tend to do this.

I am not very sure how frequently some company needs this but one of my friend needed it for sure. 🙂 I did this in my labs few months ago and worked on at least 3 production environments too. I thought I can share this with everyone who reads at my blog. However, the steps I am going to show in this blog post will only apply to Exchange 2007 and Exchange 2010 GAL. Also, the templates editor tool that we are going to use does not show Employee ID field in the bindings page.

There are few steps involved in doing this:

  1. A simple VB script stored at some location on network.
  2. Schema Admin group membership to the user account you are going to carry out this operation with.
  3. Exchange Organization Administrator group membership.

Using the Visual Basic Script

  • Copy and Paste the below text in a notepad file and save it as .vbs

On Error Resume Next
Dim objemployeeID
Dim objUser
Dim ObjTemp
Set objemployeeID = Wscript.Arguments
Set objUser = GetObject(objemployeeID(0))
objTemp = InputBox("Current Employee ID: "& objUser.employeeNumber & "If you would like to enter a new number of modify the exisitng number, enter the new number in the textbox below")
if objTemp <> "" then objUser.Put"employeeNumber",objTemp
If Err.Number = "-2147024891" Then
MsgBox "Your current account does not have permissions to modify the Employee-ID attribute. Please log on with an account with appropriate permissions.",16,"Permission Denied"
End If
Set ObjUser = Nothing
Set objemployeeID = Nothing
Set objTemp = Nothing

  • Rename this file to .vbs and store at some network share e.g. \\servername\ADScripts\EmpID.vbs . The only idea behind storing this script on a network location is to keep this available even the ADUC is used from client computers.

Editing Schema and User Display Configurations in AD configuration partition:

Warning: It is highly recommended that you back up your Active Directory before modifying anything in schema. Incorrect changes in schema can cause undesired behavior of Active Directory Services.

  • Logon to any domain controller with Schema Admin privileges.
  • Click Start –> Run and type regsvr32 schmmgmt.dll and hit enter.
  • Click OK on the information dialog that appears on the screen
  • Click Start –> Run and type MMC and press enter.
  • In MMC click File menu and select Add/Remove Snap-In.
  • Click on Add button on Add/Remove Snap-in page.
  • Select Active Directory Schema from the list that appears on the screen.
  • Click Add and click Close and click Close.
  • Expand Classes in Active Directory Schema Snap-in and locate class person.
  • Right click on class person, select Properties and click on Attributes tab.


  • Click on Add button and select employeeID


  • Repeat above step to add employeeNumber as well.
  • Now open ADSIEDIT.MSC and locate CN=user-Display,CN=409,CN=DisplaySpecifiers,CN=Configuration,DC=domain,DC=com
  • Right click on CN=user-Display and select Properties.
  • Locate the attribute adminContextMenu on Attribute Editor page and click Edit button.
  • Type ,&Employee-ID,\\adpun3\AD Scripts\EmpID.vbs exactly as shown in figure below and click Add button. (I recommend copy and paste the text in red color)


  • Click OK button and exit the ADSIEDIT.msc
  • Now open Active Directory Users and Computers and locate the user account you want to modify the Employee ID for. You will see an additional context menu item in when you right click on the desired user object.


  • A new pop up appears when you click the above context menu. You can enter or modify the Employee ID for the select user account using the the pop up.


Adding Employee ID field in Exchange 2007 Global Address List

  • Now to make this Employee ID field visible in Exchange 2007 Global Address list you can use Details Templates Editor tool from Exchange 2007 EMC.
  • Logon to your Exchange 2007 Server with Organization Administrator and open Exchange Management Console.
  • Locate and Open Details Templates Editor Tool from Toolbox node in EMC.
  • Locate the template for User type and Language English (United States) and click Edit from Actions pane. Refer below figure.


  • A new Editor Opens on the screen. Select a Label and a Edit controls from Tools pane in the opened Editor window and place them at your desired location.


  • Add details to the Label control using property editor pane in the editor tool. To do this, select The Label control that you just dragged and dropped on the template and add the text in properties pane.


  • Add details to Edit control and bind it to specific attribute in AD. To do this, select the Listbox control and select Employee ID attribute from Properties pane.


  • Save the edited template by selecting File Menu and Save.
  • Exchange GAL will show the details as shown below. If you are using outlook in cached mode then you will have to wait till the OAB is generated.


I hope you find this useful and can use when you require this. Do let me know if you have any comments on the post.

20 Responses to “How to add Employee Numbers in ADUC and Exchange GAL”

  1. Sanjay Pasupuleti said

    Good article man

  2. Thanks much Sanjay.

  3. Manoj said

    Super article man

  4. […] God blogpost om at opdatere AD med medarbejde ID oplysninger, så de efterfølgende kan bruges i Outlook: How to add Employee Numbers in ADUC and Exchange GAL. […]

  5. Mahtmoud said

    thanks for this a nice article but it do does not replicate in Gal even after day

  6. This modification relies on AD replication and OAB generation too. If you have problems with your AD replication then it simply wouldn’t show up. On the other hand if OAB generation is experiencing troubles then cached mode users will not be able to see any changes.

  7. Mahtmoud said

    sorry man but when i change in any attribute like manger it appear in outlook and i said that i waited for one day from last night and it does not appear
    r u have any trouble shoot in that?

  8. Are you sure that you saved the template after you modified it? You should be able to see blank fields in user properties in GAL at least. If these fields are not visible in GAL then your templates is not modified correctly.

  9. Mahtmoud said

    yes i am sure and if i open it i see it modifyied as i did , and it accept these change before

  10. Are you able to see the updated template in GAL? Refer last figure in the post which shows the employee number field visible. Also, can you please tell me if the users are cached mode users? What is the version of outlook you are using for seeing these changes? Please feel free to drop me a note at geek @ msexchangegeek . com if it is not fixed. I will post the whole transcript here in comments later.

  11. Mahtmoud said

    Thanks man it replicate now it just takes some time, but the Employee number attribute itself does not replicate in the figure
    Am I do anything to force it to replicate
    i use the 3 different outlook 2003, 2007, and 2010

  12. Thanks alot for the solution.

    I have one question though.

    How would you go about adding the Employee ID field next to the Default fields in the GAL for example next to the Name field.

  13. Edwin, you can simply place a new field in front of Name and use it to display the employee numbers from AD. I didn’t use the General Tab intentionally because it has a lot of stuff on it already and it would look messy if we add another field.

  14. Mahtmoud said

    thanks man again but i see all filed except th ID number
    i use exchange 2010 ????

  15. Hi, are you able to see the EmployeeNumber attribute updated in AD when you see it using ADSIEDIT.msc? If not then I suspect it could be a problem with AD and not Exchange. I would recommend you checking your AD replication and health one more time.

  16. Mahtmoud said

    yes i can its updated in attribute, but does not appeare in oulook filed

  17. okay, have you tried changing your outlook mode from cached to online?

  18. Mahtmoud said

    i change it and no change, even it was cashed mode outlook will update with OAB

    but there is some thing in the template of exchange i type Employee-number not select it because there is not drag and drop list

  19. Yash said

    Hi Geek,
    I tried this on my test enviornment & its worked fine. Thanks for nice documentation..

  20. Glad to see that this article helped you. All the best for deployment in production.

Sorry, the comment form is closed at this time.

%d bloggers like this: