Luciano
2009-05-05 16:44:02 UTC
Hi,
I have a couple of WMI Script and I would like to use all together in one
Script!? Is this possible? And how?
Also I would like to show the Information in a Webpage, some Ideas!?
For example:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where Index = 1 ")
For Each objItem in colItems
Wscript.Echo "MAC Address: " & objItem.MACAddress
For Each strAddress in objItem.IPAddress
Wscript.Echo "IP-Address: " & strAddress
For Each strIPSubnet in objItem.IPSubnet
Wscript.Echo "IP Subnet: " & strIPSubnet
For Each strGateway in objItem.DefaultIPGateway
Wscript.Echo "Gateway: " & strGateway
For Each strDNS in objItem.DNSServerSearchOrder
Wscript.Echo "DNS IP-Address: " & strDNS
Next
Next
Next
Next
Next
-With-
'Get strComputer from each line of text file.
strComputer = "."
Set objWMIService = GetObject("winmgmts://" & strComputer)
Set colOSes = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem" & "SELECT * FROM Win32_LogicalDisk")
For Each objOS in colOSes
Wscript.Echo
Wscript.Echo strComputer
Wscript.Echo "Name: " & objOS.Name
Wscript.Echo "OS Version: " & objOS.Version
Wscript.Echo "Service Pack: " & objOS.ServicePackMajorVersion & _
"." & objOS.ServicePackMinorVersion
Wscript.Echo "System Drive: " & objOS.SystemDrive
Set objSWbemServices = GetObject("winmgmts:")
Set objDisk = objSWbemServices.Get("Win32_LogicalDisk.DeviceID='C:'")
Wscript.Echo "Free Space: " & objDisk.FreeSpace
Next
Please I need your help, thank you
I have a couple of WMI Script and I would like to use all together in one
Script!? Is this possible? And how?
Also I would like to show the Information in a Webpage, some Ideas!?
For example:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where Index = 1 ")
For Each objItem in colItems
Wscript.Echo "MAC Address: " & objItem.MACAddress
For Each strAddress in objItem.IPAddress
Wscript.Echo "IP-Address: " & strAddress
For Each strIPSubnet in objItem.IPSubnet
Wscript.Echo "IP Subnet: " & strIPSubnet
For Each strGateway in objItem.DefaultIPGateway
Wscript.Echo "Gateway: " & strGateway
For Each strDNS in objItem.DNSServerSearchOrder
Wscript.Echo "DNS IP-Address: " & strDNS
Next
Next
Next
Next
Next
-With-
'Get strComputer from each line of text file.
strComputer = "."
Set objWMIService = GetObject("winmgmts://" & strComputer)
Set colOSes = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem" & "SELECT * FROM Win32_LogicalDisk")
For Each objOS in colOSes
Wscript.Echo
Wscript.Echo strComputer
Wscript.Echo "Name: " & objOS.Name
Wscript.Echo "OS Version: " & objOS.Version
Wscript.Echo "Service Pack: " & objOS.ServicePackMajorVersion & _
"." & objOS.ServicePackMinorVersion
Wscript.Echo "System Drive: " & objOS.SystemDrive
Set objSWbemServices = GetObject("winmgmts:")
Set objDisk = objSWbemServices.Get("Win32_LogicalDisk.DeviceID='C:'")
Wscript.Echo "Free Space: " & objDisk.FreeSpace
Next
Please I need your help, thank you