Re: I can't get this to output how I want
- From: sbconway@xxxxxxxxxxx
- Date: 11 May 2005 15:35:15 -0700
Try using this connection string instead:
Const BYTES_IN_MEG = 1048576
Const MEGS_IN_GIG = 1024
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
UserName = ""
Password = ""
arrComputers = Array("sally") '. works but remote computers don't :S
For Each strComputer In arrComputers
WScript.Echo
"================================================================="
WScript.Echo "Information about Network Connections on: " &
strComputer
WScript.Echo
"================================================================="
Set objWMIService =
SWBemlocator.ConnectServer(strComputer,"\root\CIMV2",UserName,Password)
Set colItems = objWMIService.ExecQuery("Select * from
Win32_LogicalDisk WHERE DriveType=4",,48)
For Each objItem In colItems
WScript.Echo "Description: " & objItem.Description
WScript.Echo "DeviceID: " & objItem.DeviceID
WScript.Echo "ProviderName: " & objItem.ProviderName
WScript.Echo "FileSystem: " & objItem.FileSystem
WScript.Echo "FreeSpace: " & BytesToGigs( objItem.FreeSpace ) & "G"
WScript.Echo
Next
Next
Function BytesToGigs( sizeInBytes )
BytesToGigs = Round( ((sizeInBytes / BYTES_IN_MEG) / MEGS_IN_GIG), 2 )
End Function
.
- References:
- I can't get this to output how I want
- From: Steven Platt
- Re: I can't get this to output how I want
- From: Steven Platt
- I can't get this to output how I want
- Prev by Date: WMI Query for on board security chip
- Next by Date: WMI security context
- Previous by thread: Re: I can't get this to output how I want
- Next by thread: (running GetObject to remote winmgmts) while script is embedded in an HTML file
- Index(es):
Relevant Pages
|
Loading