Nos mantendra en la descripcion del equipo de active directory el User, Serial Number & Computer Model
'-----------------------------------------------------------------------
' Created 3/29/2011
' When used as login script it will populate the Computer Description
' in Active Directory with User Description, Serial Number & CompModel
'----------------------------------------------------------------------
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colcomputersystem = objWMIService.ExecQuery _
("Select * from Win32_computersystem")
Set colBIOS = objWMIService.ExecQuery _
("Select * from Win32_BIOS")
For each objcomputersystem in colcomputersystem
Getcomputersystem = objcomputersystem.Model
Next
For each objBIOS in colBIOS
GetSerialNumber = objBIOS.SerialNumber
Next
Set objSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
strMessage = objUser.DisplayName & " / " & Getcomputersystem & " / " & GetSerialNumber
objComputer.Description = strMessage
objComputer.SetInfo
No hay comentarios:
Publicar un comentario