Add custom field to ADUC- Employee ID
How to add Employee ID to Active Directory Users and Computers
1. Open ADSI Edit
2. Expand the CN=Configuration node and go to CN=DisplaySpecifiers, CN=409. Select the 409 node in the left hand pane.
3.In the right-hand pane, select the CN=user-Display object. Right click and select Properties.
4.Select the adminContextMenu attribute and click Edit.
5. We now need to add the value that will be used to create the additional menu item and direct it to the employeeID.vbs script. The syntax is very important. Be sure to include the comma at the beginning and after the menu name (Employee-ID). Add the following syntax to the Value to Add: line:
,&Employee-ID,\\servername\sharename\employeeID.vbs (your VBS file must be stored on shared location in order to allow all domain controllers to access it)
6.Change the servername and sharename items to reflect your current environment and then click Add.
7.Click OK to accept the changes and close ADSI Edit.
8.Allow some time for replication to populate the changes throughout the directory.
9.Open ADUC and select a user. Right click on the user and notice the new menu item now available.
10. Select Employee-ID to launch the script from within the ADUC. From here we can either enter a new value for the employeeID attribute for the user or hit Cancel to leave the current value intact. (Note: If no value is present in the field, then the attribute value is empty for that user.)
VBSscript – just copy and paste in notepad, than save as employeeID.vbs and copy to shared folder.
Dim objEmployeeID
Dim objSelectedUser
Dim strNewEmployeeID
Set objEmployeeID = Wscript.Arguments
Set objSelectedUser = GetObject(objEmployeeID(0))
strNewEmployeeID = InputBox(“Employee ID: ” & objSelectedUser.employeeID & vbCRLF _
& vbCRLF _
& “To enter a new Employee ID number,” _
& ” type it into the text box” _
& ” below and click OK.”)
if strNewEmployeeID <> “” Then
objSelectedUser.Put “employeeID”,strNewEmployeeID
end if
objSelectedUser.SetInfo
WScript.Quit
When you right click on user in ADUC you will see new field (EmployeeID)
on December 10th, 2008 at 1:11 pm
Can you do this with the employeeType attribute as well?
We have need for that field more than ID.
on December 10th, 2008 at 1:46 pm
Jim .
It can be done with any field, I recently did that by adding skype field to ADUC .
Check Microsoft Development center .
on December 10th, 2008 at 2:34 pm
Thanks. I don’t do a lot of scripts but it looks simple enough to change. I’ll look on the MS site.
on May 13th, 2009 at 1:46 pm
Hi
When i run this script it comes with error messages saying
Expected: ‘)’
line: 6
Char: 73
Any Suggestions Please
on May 13th, 2009 at 2:12 pm
Kieran,
You should check your line 6 and character 73,
Check if you don’t have any mistakes..
Try to use TextPad or Notepad++
on June 30th, 2009 at 10:52 am
Hello all,
Script seems no to be working. I have followed all steps but employee id does not appear.
Script is done by copy paste but does not work.
Any ideas?
Thanks,
on July 1st, 2009 at 4:43 am
Employee ID appears on right click ,
I sagest you to check again .
It works for me, and many others.
on November 5th, 2009 at 4:05 pm
If I add a custom field to ADUC 2003, will the field still be there if I upgrade to ADUC 2008?
on November 5th, 2009 at 4:27 pm
Hi Chad ,
Didn’t have chance to test. but reason tells me that it should be there, it is attribute extension . Schema attributes don’t get deleted during upgrade.
I suggest you testing it in LAB environment before proceed.
on November 17th, 2009 at 5:21 pm
I currently have this working in my test area on Server 2008, thank you. But I have a question, is there a way to actually have this appear in the “General” or “Organization” tab under ADUC when looking at the properties of a user?
As an additional question with this working “as is” and showing up on a right click, will it pass this information (employee ID) when using the GetUserProfile Service through MOSS 2007?
on November 19th, 2009 at 4:41 pm
I would like to implement this on AD 2000.
I could see EmployeeID field on my LDAP browser and mantain it using Hyena software
What is your experience?
Thanks.
on January 20th, 2010 at 6:00 pm
I had a problem with the vbs code and fixed it by replacing all the quotation marks.
” was replaced with ” .
on May 20th, 2010 at 11:35 am
i want to change the Pager attribute in the telephone tab in the users and computers with Skype … not sure how to do this
on May 23rd, 2010 at 11:36 am
You can do it by using exchange template editor.
It won’t change AD menu but everything you type in pager field will be displayed in outlook as Skype.
Is that good enough?
on July 27th, 2010 at 9:25 am
Iam getting subscription out of range error at line no 5 at char 1 any idea to rectify this error
on August 2nd, 2010 at 9:18 pm
Hey anil i am having the same error, did you get it to work?
on August 10th, 2010 at 9:13 pm
Hello,
I am currently trying to find a way to set the Employee ID to Null using a vbscript similar to yours. Is this possible?
Thanks,
Kyle