/build/static/layout/Breadcrumb_cap_w.png

KACE: Computer Description VBS

Summary:  Here is a vbs script that a customer actually wrote that changes the computer description based on serial number and model. He had his setup as a GPO that ran on each target. Since the computer description can be changed by the user, he set it to run on boot up and shutdown so it would always show the same:

 The VBS Script:

 

 

''''''

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")

Set colBIOS = objWMIService.ExecQuery ("Select * from Win32_BIOS")

For each objBIOS in colBIOS

    strSerial = objBIOS.SerialNumber

next

 

 

For Each objComputer in colSettings

    strModel = objComputer.Model

next

 

Const HKEY_LOCAL_MACHINE = &H80000002

 

strComputer = "."

 

Set objRegistry = GetObject ("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

 

strKeyPath = "System\CurrentControlSet\Services\lanmanserver\parameters"

 

 

strValueName = "srvcomment"

strDescription = strModel & " - " & strSerial

 

 

objRegistry.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strDescription ''''


Comments

This post is locked

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ