I would just use VBScript and WMI to gather the information.
[code]
'=======================================================================
===
'
' NAME: ReportServerDiskUtilization.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: http://www.thespidersparlor.com
' DATE : 7/9/2009
' COPYRIGHT C 2009, All Rights Reserved
'
' COMMENT:
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE
SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
'=======================================================================
===
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
'Create our log
Set ts = objFSO.CreateTextFile("DiskUtilization.txt",True)
'Enum Servers In Domain
Set oRootDSE = GetObject("LDAP://rootDSE")
strDom = oRootDSE.Get("DefaultNamingContext")
' available categories = computer, user, printqueue, group
qQuery = "<LDAP://" & strDom & ">;" & _
"(objectCategory=computer)" & _
";name,operatingSystem;subtree"
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Open "Provider=ADsDSOObject;"
objCommand.ActiveConnection = objConnection
objCommand.CommandText = qQuery
Set objRecordSet = objCommand.Execute
Do until objRecordSet.EOF
If InStr(objRecordSet.Fields("operatingSystem"),"Server") > 1 Then
'Verify server is online first
strComputer = objRecordSet.Fields("name")
PingCheck = PingStatus(strComputer)
If PingCheck = "Success" Then
Report = GetServerDiskInfo(objRecordSet.Fields("name"))
Else
Report = strComputer & " is offline" & vbCrLf &
"******************************************" & vbCrLf
End If
PingCheck = ""
strComputer = ""
ts.Write Report
End If
objrecordset.MoveNext
loop
objConnection.Close
'Close the report file
ts.Close
WshShell.Run("notepad.exe DiskUtilization.txt")
WScript.Quit
Function PingStatus(strComputer)
On Error Resume Next
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colPings = objWMIService.ExecQuery _
("SELECT * FROM Win32_PingStatus WHERE Address = '" & strComputer
& "'")
For Each objPing in colPings
Select Case objPing.StatusCode
Case 0 PingStatus = "Success"
Case Else PingStatus = "Offline"
End Select
Next
End Function
Function GetServerDiskInfo(strComputer)
'Now Get Disk Information For the Servers
'Bind to WMI on the target server
On Error Resume Next
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
If Err.Number = 0 Then
report = report & strComputer & " Disk Drive Information" & vbCrLf &
"******************************************" & vbCrLf & vbCrLf
Set colItems = objWMIService.ExecQuery("Select * from
Win32_LogicalDisk where DriveType = '3'",,48)
For Each objItem in colItems
report = report & "Drive: " & objItem.Caption & vbCrLf
report = report & "VolumeSerialNumber: " &
objItem.VolumeSerialNumber& vbCrLf
report = report & "Description: " & objItem.Description& vbCrLf
report = report & "Size: " & objItem.Size /1024\1024+1 & "MB
Total Disk Space" & vbCrLf
report = report & "Free Space: " & objItem.FreeSpace /1024\1024+1
& "MB Free Disk Space" & vbCrLf & vbCrLf
Next
Else
report = strComputer & " is unreachable via WMI" & vbCrLf &
"******************************************" & vbCrLf
End If
On Error Goto 0
GetServerDiskInfo = report
End Function
[/code]
--