Hi, you can use this VBS script to get Computer model,serial,logged user.
Add this to logon script when user logs to domain it will scan computer and send data to file. File name will be "computer serial".txt
I have
bolded text what you have to modify to work on your network.
You have to save this file to .VBS extension. Example to make this is to open notepad copy/paste text and save. Then change extension to .VBS.
On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
arrComputers = Array("localhost")
For Each strComputer In arrComputers
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystemProduct", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
' write data to text file '
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile ("ENTER SERVER SHARE WHERE USER HAS ACCESS TO WRITE example \\server\logs\" & objItem.IdentifyingNumber & ".txt", True)
tf.Write "Serial: " & objItem.IdentifyingNumber
tf.WriteBlankLines(1)
tf.Write "Model: " & objItem.Name
tf.WriteBlankLines(2)
tf.Write "Vendor: " & objItem.Vendor
tf.WriteBlankLines(1)
tf.Write "Version: " & objItem.Version
tf.WriteBlankLines(2)
Next
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
tf.Write "Username: " & objItem.UserName
tf.WriteBlankLines(1)
tf.Write "Hostname: " & objItem.Name
tf.WriteBlankLines(1)
tf.Write "Domain: " & objItem.Domain
tf.WriteBlankLines(1)
tf.Close
' write data to text file, end '
Next
Next
Message Edited by outouser on
04-11-2008 12:10 PM
Message to moderators please disable smileys on my post. My code wont show correctly. I cannot see any option to disable it by myself.
Message Edited by outouser on
04-11-2008 12:15 PMMessage Edited by billbolton on
04-12-2008 12:16 AM