Adding Extra Information in Active Directory

Adding extra information against domain users in Active Directory for creation of link between Intranet website or any other external software. Just suppose, we want to add "Attendance ID" and "Payroll ID" fields in Active Directory (AD). Before starting this process, please make sure that an successful system State Backup of Domain and Active Directory has been done. First, you install the Windows Server Support Tools from the Windows Server CD-ROM (Support/Tools), then perform the following steps:

  • Install the Schema snap-in (Start, Run, regsvr32 schmmgmt.dll)
  • To add the employeeID and employeeNumber attributes to the person class, open the Schema console, run MMC then from Add/Remove Snap-in, select Active Directory Schema, and from Schema console navigate to Classes, Person. Right-click Person and select Properties, select Attributes, select admincontextmenu, click Edit, click Add, then locate and click employeeID. Click OK. Click Add again. Locate and click employeeNumber, then click OK twice to close both dialog boxes.
  • Open the Active Directory Service Interfaces (ADSI) Edit utility, then navigate to Configuration Container, CN=Configuration, CN=DisplaySpecifiers, CN=409.
  • In the right-pane, locate and right-click CN=user-display, and select Properties.
  • In the Edit Attribute box, type &Attendnace ID, attend_id.vbs (Please find "attend_id.vbs" contents, bottom of this post) again click Add, and type &Payroll ID, payroll_id.vbs (Please find "payroll_id.vbs" contents, bottom of this post)
  • These steps configure the options Attendance ID and Payroll ID on the context menu for a user in the Microsoft Management Console (MMC) Active Directory Users and Computers snap-in.
  • Please copy these two VB Script files on any shared location for accessing from PDC and ADC.

After performing these steps, we will able to define Attendance ID's from Attendance System and Payroll ID's from Payroll System against all the users of Active Directory.

Contents of ATTEND_ID.VBS:
Dim oVar
Dim oUsr
Dim tmp
Set oVar = Wscript.Arguments
Set oUsr = GetObject(oVar(0))
tmp = InputBox("The Attendance ID of the user is: " & oUsr.employeeID & vbCRLF & vbCRLF & "If you would like enter a new ID or modify the existing ID, enter the new ID in the textbox below","Attendance ID")
if tmp <> "" then oUsr.Put "employeeID",tmp
oUsr.SetInfo
Set oUsr = Nothing
WScript.Quit

Contents of PAYROLL_ID.VBS:
Dim oVar
Dim oUsr
Dim tmp
Set oVar = Wscript.Arguments
Set oUsr = GetObject(oVar(0))
tmp = InputBox("The Payroll ID for this user is: " & oUsr.EmployeeNumber & vbCRLF & vbCRLF & "If you would like enter a new ID or modify the existing ID, enter the new ID in the textbox below","Payroll ID")
if tmp <> "" then oUsr.Put "employeeNumber",tmp
oUsr.SetInfo
Set oUsr = Nothing
WScript.Quit

Copy these contents and save as "ATTEND_ID.VBS" and "PAYROLL_ID.VBS".

No comments:

Post a Comment