Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting remote machine information

Status
Not open for further replies.

it2hill

IS-IT--Management
Sep 5, 2002
28
US
Good day all,

I am trying to get some information from remote machines. I have searched and found where I can substitute the host name for the “.” In the below script

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem", , 48)
For Each objItem In colItems
Debug.Print "Manufacturer: " & objItem.Manufacturer
Next

I have tried the hostname and ip with no result. ObjWMIService and colItems are both blank in when I step through in debug. I am able to ping the hostname and ip without any problems.

How can I get the information from a remote machine?

Thanks for you time,

Shane
 
Sub ListProcessorProperties( strComputer )
Dim objWMIService, colItems
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor",,48)
For Each objItem in colItems
Wscript.Echo "AddressWidth: " & objItem.AddressWidth
Wscript.Echo "Architecture: " & objItem.Architecture
Wscript.Echo "Availability: " & objItem.Availability
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
Wscript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
Wscript.Echo "CpuStatus: " & objItem.CpuStatus
Wscript.Echo "CreationClassName: " & objItem.CreationClassName
Wscript.Echo "CurrentClockSpeed: " & objItem.CurrentClockSpeed
Wscript.Echo "CurrentVoltage: " & objItem.CurrentVoltage
Wscript.Echo "DataWidth: " & objItem.DataWidth
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "DeviceID: " & objItem.DeviceID
Wscript.Echo "ErrorCleared: " & objItem.ErrorCleared
Wscript.Echo "ErrorDescription: " & objItem.ErrorDescription
Wscript.Echo "ExtClock: " & objItem.ExtClock
Wscript.Echo "Family: " & objItem.Family
Wscript.Echo "InstallDate: " & objItem.InstallDate
Wscript.Echo "L2CacheSize: " & objItem.L2CacheSize
Wscript.Echo "L2CacheSpeed: " & objItem.L2CacheSpeed
Wscript.Echo "LastErrorCode: " & objItem.LastErrorCode
Wscript.Echo "Level: " & objItem.Level
Wscript.Echo "LoadPercentage: " & objItem.LoadPercentage
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "MaxClockSpeed: " & objItem.MaxClockSpeed
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "OtherFamilyDescription: " & objItem.OtherFamilyDescription
Wscript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
Wscript.Echo "PowerManagementCapabilities: " & objItem.PowerManagementCapabilities
Wscript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
Wscript.Echo "ProcessorId: " & objItem.ProcessorId
Wscript.Echo "ProcessorType: " & objItem.ProcessorType
Wscript.Echo "Revision: " & objItem.Revision
Wscript.Echo "Role: " & objItem.Role
Wscript.Echo "SocketDesignation: " & objItem.SocketDesignation
Wscript.Echo "Status: " & objItem.Status
Wscript.Echo "StatusInfo: " & objItem.StatusInfo
Wscript.Echo "Stepping: " & objItem.Stepping
Wscript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
Wscript.Echo "SystemName: " & objItem.SystemName
Wscript.Echo "UniqueId: " & objItem.UniqueId
Wscript.Echo "UpgradeMethod: " & objItem.UpgradeMethod
Wscript.Echo "Version: " & objItem.Version
Wscript.Echo "VoltageCaps: " & objItem.VoltageCaps
Next
End Sub

 
What OS are the remote machines running? IE, is WMI present and running?

You're logged into the local machine as YourDomain\YourUser. Is YourDomain\YourUser an administrator on the remote machines?

Remove the On Error statement, re-run the script, and note the displayed error.

Jon Hawkins
 
Jon,

Thanks for the response and your time. The remote machine is identical (OS and IE) as mine. We are on the same domain, but I am not admin on the remote machine. I removed the on error and here is what I have:

Line: 2
Char: 1
Error: 0x80041003
Code: 80041003
Source: (null)

I was afraid it has to do with security (still not sure what the above error means). I am working in our office and was using a co-workers machine to test as my remote machine. Some of our customers give us admin right and some do not. Sometimes the remote machine is on the same domain, sometimes not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top