10.22.2013

Add PC Serial to Active Directory Users and Computers Right-click context Menu

Add PC Serial to Active Directory Users and Computers Right-click context Menu

PCSerial.vbs

============================================================
On Error Resume Next
Dim System
Set wshArguments = WScript.Arguments
Set objUser = GetObject(wshArguments(0))
winmgmt1 = "winmgmts:{impersonationLevel=impersonate}!//"& objUser.dNsHostName &""
Set SNSet = GetObject( winmgmt1 ).InstancesOf ("Win32_BIOS")
for each SN in SNSet
MsgBox "The serial number for the specified computer is: " & SN.SerialNumber
Next

============================================================

Save this script as .vbs file into \\DOMAIN.LOCAL\NETLOGON directory.
StartADSI Edit tool 
Right-Click and hit Connect To
Choose Configuration and Click OK
Look for the following Key: 

CN=409,CN=DisplaySpecifiers,CN=Configuration,DC=domain,DC=local

There look for CN=computer-Display. Right-click on CN=computer-Display and select Properties.

aduc01

In attribute adminContextMenu add following line:
2, &PC Serial,\\DOMAIN.LOCAL\NETLOGON\PCSerial.vbs
You will not get a right-click option in Active Directory Users and Computers for querying the PC Serial number. 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.