Set objNetwork = CreateObject("Wscript.Network")
Set objADSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objADSysInfo.UserName)
SetComputerDescription objUser.Mail
Function SetComputerDescription(computerDescription)
Dim objSWbemServices,colSWbemObjectSet,objSWbemObject
Set objSWbemServices = GetObject("winmgmts:\\.\root\cimv2")
Set colSWbemObjectSet = objSWbemServices.InstancesOf("Win32_OperatingSystem")
For Each objSWbemObject In colSWbemObjectSet
objSWbemObject.Description = computerDescription
On Error Resume Next
objSWbemObject.Put_
Next
End Function
|