Below script will give you the computer system details of a remote computer
strComputer = "FullComputerName"
strDomain = "DOMAIN"
strUser = "username"
strPassword = "password"
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objSWbemLocator.ConnectServer(strComputer, _
"root\CIMV2", _
strUser, _
strPassword, _
"MS_409", _
"ntlmdomain:" + strDomain)
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystem",,48)
For Each objItem in colItems
Wscript.Echo "Win32_ComputerSystem instance"
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Domain: " & objItem.Domain
Wscript.Echo "InstallDate: " & objItem.InstallDate
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Model: " & objItem.Model
Next
"Scripting" is basically giving sequential instructions to computer for doing specific things rather than doing manually. Sometimes we need to write a small and quick vbscript (.vbs), javascript(.js), batch file(.bat) or SQL script(.sql) to perform a short task, but we lack information or get confuse on where to start or which scrpit to write. In my BLOG, I will try to cover as many different scripts as possible that will be useful to everyone.
No comments:
Post a Comment