Home All Groups Group Topic Archive Search About
Author
9 Jul 2009 12:01 AM
Eldingo
Hello friends:

Is there a way to get a report on disc space usage on all the servers in the
domain. I need to do report on disc space availability on a monthly basis.
Appreciate your help.

-ciao

Author
9 Jul 2009 12:06 AM
kj [SBS MVP]
Eldingo wrote:
> Hello friends:
>
> Is there a way to get a report on disc space usage on all the servers
> in the domain. I need to do report on disc space availability on a
> monthly basis. Appreciate your help.
>
> -ciao

What server OS versions?


--
/kj
Author
9 Jul 2009 2:15 AM
Eldingo
Hi kj, it is window server 2003.

Show quoteHide quote
"kj [SBS MVP]" <KevinJ.SBS@SPAMFREE.gmail.com> wrote in message
news:%23%23fNWkCAKHA.5068@TK2MSFTNGP03.phx.gbl...
> Eldingo wrote:
>> Hello friends:
>>
>> Is there a way to get a report on disc space usage on all the servers
>> in the domain. I need to do report on disc space availability on a
>> monthly basis. Appreciate your help.
>>
>> -ciao
>
> What server OS versions?
>
>
> --
> /kj
>
Author
9 Jul 2009 7:59 PM
jeff archacki
Hello Eldingo,

Show quoteHide quote
> Hi kj, it is window server 2003.
>
> "kj [SBS MVP]" <KevinJ.SBS@SPAMFREE.gmail.com> wrote in message
> news:%23%23fNWkCAKHA.5068@TK2MSFTNGP03.phx.gbl...
>
>> Eldingo wrote:
>>
>>> Hello friends:
>>>
>>> Is there a way to get a report on disc space usage on all the
>>> servers in the domain. I need to do report on disc space
>>> availability on a monthly basis. Appreciate your help.
>>>
>>> -ciao
>>>
>> What server OS versions?
>>
>> -- /kj
>>

As long as they all have SNMP enabled you can use any program that can trap
SNMP info. There's a whole page of them here: http://www.practicallynetworked.com/support/snmp_apps.htm
I just use Cacti on a Linux box.
Author
9 Jul 2009 1:54 AM
Richard Mueller [MVP]
"Eldingo" <eldi***@dingo.net> wrote in message
news:%236aumhCAKHA.528@TK2MSFTNGP03.phx.gbl...
> Hello friends:
>
> Is there a way to get a report on disc space usage on all the servers in
> the domain. I need to do report on disc space availability on a monthly
> basis. Appreciate your help.
>
> -ciao

A VBScript program to retrieve disk space information from computers read
from a text file:
=========
Option Explicit

Dim strServerFile, objFSO, objFile
Dim objShell, strTemp, strTempFile, strComputer
Dim objWMIService, colDisks, objDisk

Const ForReading = 1
Const HARD_DISK = 3

' Specify file of server NetBIOS names.
strServerFile = "c:\rlm\Scripts\Servers.txt"

' Specify temporary file to save ping results.
Set objShell = CreateObject("Wscript.Shell")
strTemp = objShell.ExpandEnvironmentStrings("%TEMP%")
strTempFile = strTemp & "\RunResult.tmp"

' Open the file for reading.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strServerFile, ForReading)

' Read server names from the file.
Do Until objFile.AtEndOfStream
    strComputer = Trim(objFile.ReadLine)
    ' Skip blank lines.
    If (strComputer <> "") Then
        ' Ping computer to see if online.
        If (IsConnectible(strComputer, 1, 750) = True) Then
            ' Connect to server with WMI.
            On Error Resume Next
            Set objWMIService = GetObject("winmgmts:" _
                &
"{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
                & strComputer & "\root\cimv2")
            If (Err.Number <> 0) Then
                On Error GoTo 0
                Wscript.Echo strComputer & ": WMI not installed"
            Else
                On Error GoTo 0
                Wscript.Echo strComputer
                ' Enumerate hard disks.
                Set colDisks = objWMIService.ExecQuery _
                    ("SELECT * FROM Win32_LogicalDisk " _
                        & "WHERE DriveType = " & HARD_DISK & "")
                For Each objDisk In colDisks
                    Wscript.Echo "-- Device ID:       " & objDisk.DeviceID
                    Wscript.Echo "-- File System:     " & objDisk.FileSystem
                    Wscript.Echo "-- Disk Size:       " &
FormatNumber(objDisk.Size, 0)
                    Wscript.Echo "-- Free Disk Space: " &
FormatNumber(objDisk.FreeSpace, 0)
                Next
            End If
        Else
            Wscript.Echo strServer & " not available"
        End If
    End If
Loop

' Clean up.
objFile.Close
If (objFSO.FileExists(strTempfile) = True) Then
    objFSO.DeleteFile(strTempFile)
End If

Function IsConnectible(ByVal strHost, ByVal intPings, ByVal intTO)
    ' Returns True if strHost can be pinged.
    ' Based on a program by Alex Angelopoulos and Torgeir Bakken.
    Dim objFile, strResults

    If (intPings = "") Then
        intPings = 2
    End If
    If (intTO = "") Then
        intTO = 750
    End If

    Const OpenAsDefault = -2
    Const FailIfNotExist = 0
    Const ForReading = 1

    objShell.Run "%comspec% /c ping -n " & intPings & " -w " & intTO _
        & " " & strHost & ">" & strTempFile, 0, True

    Set objFile = objFSO.OpenTextFile(strTempFile, ForReading, _
        FailIfNotExist, OpenAsDefault)
    strResults = objFile.ReadAll
    objFile.Close

    Select Case InStr(strResults, "TTL=")
        Case 0
            IsConnectible = False
        Case Else
            IsConnectible = True
    End Select
End Function
=====
This should be run from a command prompt using cscript. The output can be
redirected to a text file. The text file should have the NetBIOS names of
the computers, one per line. Change the name and path of this file to suit
your situation.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
Author
9 Jul 2009 2:21 AM
Eldingo
Richard, thanks much for the script. I'll start using it right away.


Show quoteHide quote
"Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in
message news:u6KP5gDAKHA.4336@TK2MSFTNGP04.phx.gbl...
>
> "Eldingo" <eldi***@dingo.net> wrote in message
> news:%236aumhCAKHA.528@TK2MSFTNGP03.phx.gbl...
>> Hello friends:
>>
>> Is there a way to get a report on disc space usage on all the servers in
>> the domain. I need to do report on disc space availability on a monthly
>> basis. Appreciate your help.
>>
>> -ciao
>
> A VBScript program to retrieve disk space information from computers read
> from a text file:
> =========
> Option Explicit
>
> Dim strServerFile, objFSO, objFile
> Dim objShell, strTemp, strTempFile, strComputer
> Dim objWMIService, colDisks, objDisk
>
> Const ForReading = 1
> Const HARD_DISK = 3
>
> ' Specify file of server NetBIOS names.
> strServerFile = "c:\rlm\Scripts\Servers.txt"
>
> ' Specify temporary file to save ping results.
> Set objShell = CreateObject("Wscript.Shell")
> strTemp = objShell.ExpandEnvironmentStrings("%TEMP%")
> strTempFile = strTemp & "\RunResult.tmp"
>
> ' Open the file for reading.
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objFile = objFSO.OpenTextFile(strServerFile, ForReading)
>
> ' Read server names from the file.
> Do Until objFile.AtEndOfStream
>    strComputer = Trim(objFile.ReadLine)
>    ' Skip blank lines.
>    If (strComputer <> "") Then
>        ' Ping computer to see if online.
>        If (IsConnectible(strComputer, 1, 750) = True) Then
>            ' Connect to server with WMI.
>            On Error Resume Next
>            Set objWMIService = GetObject("winmgmts:" _
>                &
> "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
>                & strComputer & "\root\cimv2")
>            If (Err.Number <> 0) Then
>                On Error GoTo 0
>                Wscript.Echo strComputer & ": WMI not installed"
>            Else
>                On Error GoTo 0
>                Wscript.Echo strComputer
>                ' Enumerate hard disks.
>                Set colDisks = objWMIService.ExecQuery _
>                    ("SELECT * FROM Win32_LogicalDisk " _
>                        & "WHERE DriveType = " & HARD_DISK & "")
>                For Each objDisk In colDisks
>                    Wscript.Echo "-- Device ID:       " & objDisk.DeviceID
>                    Wscript.Echo "-- File System:     " &
> objDisk.FileSystem
>                    Wscript.Echo "-- Disk Size:       " &
> FormatNumber(objDisk.Size, 0)
>                    Wscript.Echo "-- Free Disk Space: " &
> FormatNumber(objDisk.FreeSpace, 0)
>                Next
>            End If
>        Else
>            Wscript.Echo strServer & " not available"
>        End If
>    End If
> Loop
>
> ' Clean up.
> objFile.Close
> If (objFSO.FileExists(strTempfile) = True) Then
>    objFSO.DeleteFile(strTempFile)
> End If
>
> Function IsConnectible(ByVal strHost, ByVal intPings, ByVal intTO)
>    ' Returns True if strHost can be pinged.
>    ' Based on a program by Alex Angelopoulos and Torgeir Bakken.
>    Dim objFile, strResults
>
>    If (intPings = "") Then
>        intPings = 2
>    End If
>    If (intTO = "") Then
>        intTO = 750
>    End If
>
>    Const OpenAsDefault = -2
>    Const FailIfNotExist = 0
>    Const ForReading = 1
>
>    objShell.Run "%comspec% /c ping -n " & intPings & " -w " & intTO _
>        & " " & strHost & ">" & strTempFile, 0, True
>
>    Set objFile = objFSO.OpenTextFile(strTempFile, ForReading, _
>        FailIfNotExist, OpenAsDefault)
>    strResults = objFile.ReadAll
>    objFile.Close
>
>    Select Case InStr(strResults, "TTL=")
>        Case 0
>            IsConnectible = False
>        Case Else
>            IsConnectible = True
>    End Select
> End Function
> =====
> This should be run from a command prompt using cscript. The output can be
> redirected to a text file. The text file should have the NetBIOS names of
> the computers, one per line. Change the name and path of this file to suit
> your situation.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
>
Author
9 Jul 2009 5:45 AM
dileep.ponna
Hello Richard,

I am little bit weak in VB script, I used to get an error at

C:\tasks\diskspace in computers listed.vbs(32, 2) Microsoft VBScript compilation error: Invalid character

where 32 line 2 char at & as I completely copied from your script shared.

Set objWMIService = GetObject("winmgmts:" _
&
"{impersonationLevel=impersonate,authenticationLev el=Pkt}!\\" _
& strComputer & "\root\cimv2")


Please suggest -- dileep.ponna ------------------------------------------------------------------------ dileep.ponna's Profile: http://forums.techarena.in/members/88349.htm View this thread: http://forums.techarena.in/active-directory/1210418.htmhttp://forums.techarena.in
Author
9 Jul 2009 12:50 PM
Richard Mueller [MVP]
Show quote Hide quote
"dileep.ponna" <dileep.ponna.3v1mnc@DoNotSpam.com> wrote in message
news:dileep.ponna.3v1mnc@DoNotSpam.com...
>
> Hello Richard,
>
> I am little bit weak in VB script, I used to get an error at
>
> C:\tasks\diskspace in computers listed.vbs(32, 2) Microsoft VBScript
> compilation error: Invalid character
>
> where 32 line 2 char at & as I completely copied from your script
> shared.
>
> Set objWMIService = GetObject("winmgmts:" _
> &
> "{impersonationLevel=impersonate,authenticationLev el=Pkt}!\\" _
> & strComputer & "\root\cimv2")
>
>
> Please suggest
>

It looks like line wrapping in the message messed up the code I pasted. The
statement takes up 3 lines, the first two of which end with the line
continuation character "_". The statement should be:

Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
    & strComputer & "\root\cimv2")

I hope this helps.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
Author
9 Jul 2009 12:18 PM
Paul Bergson [MVP-DS]
We script ours as well, we output to a csv file and it is kept for
historical purposes so we can go back and look at growth and project out on
future disk consumption as well as look at pig users who consume and never
clean up disk space.

--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4
Microsoft's Thrive IT Pro of the Month - June 2009

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup This
posting is provided "AS IS" with no warranties, and confers no rights.

Show quoteHide quote
"Eldingo" <eldi***@dingo.net> wrote in message
news:eU0bovDAKHA.3612@TK2MSFTNGP04.phx.gbl...
> Richard, thanks much for the script. I'll start using it right away.
>
>
> "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in
> message news:u6KP5gDAKHA.4336@TK2MSFTNGP04.phx.gbl...
>>
>> "Eldingo" <eldi***@dingo.net> wrote in message
>> news:%236aumhCAKHA.528@TK2MSFTNGP03.phx.gbl...
>>> Hello friends:
>>>
>>> Is there a way to get a report on disc space usage on all the servers in
>>> the domain. I need to do report on disc space availability on a monthly
>>> basis. Appreciate your help.
>>>
>>> -ciao
>>
>> A VBScript program to retrieve disk space information from computers read
>> from a text file:
>> =========
>> Option Explicit
>>
>> Dim strServerFile, objFSO, objFile
>> Dim objShell, strTemp, strTempFile, strComputer
>> Dim objWMIService, colDisks, objDisk
>>
>> Const ForReading = 1
>> Const HARD_DISK = 3
>>
>> ' Specify file of server NetBIOS names.
>> strServerFile = "c:\rlm\Scripts\Servers.txt"
>>
>> ' Specify temporary file to save ping results.
>> Set objShell = CreateObject("Wscript.Shell")
>> strTemp = objShell.ExpandEnvironmentStrings("%TEMP%")
>> strTempFile = strTemp & "\RunResult.tmp"
>>
>> ' Open the file for reading.
>> Set objFSO = CreateObject("Scripting.FileSystemObject")
>> Set objFile = objFSO.OpenTextFile(strServerFile, ForReading)
>>
>> ' Read server names from the file.
>> Do Until objFile.AtEndOfStream
>>    strComputer = Trim(objFile.ReadLine)
>>    ' Skip blank lines.
>>    If (strComputer <> "") Then
>>        ' Ping computer to see if online.
>>        If (IsConnectible(strComputer, 1, 750) = True) Then
>>            ' Connect to server with WMI.
>>            On Error Resume Next
>>            Set objWMIService = GetObject("winmgmts:" _
>>                &
>> "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
>>                & strComputer & "\root\cimv2")
>>            If (Err.Number <> 0) Then
>>                On Error GoTo 0
>>                Wscript.Echo strComputer & ": WMI not installed"
>>            Else
>>                On Error GoTo 0
>>                Wscript.Echo strComputer
>>                ' Enumerate hard disks.
>>                Set colDisks = objWMIService.ExecQuery _
>>                    ("SELECT * FROM Win32_LogicalDisk " _
>>                        & "WHERE DriveType = " & HARD_DISK & "")
>>                For Each objDisk In colDisks
>>                    Wscript.Echo "-- Device ID:       " & objDisk.DeviceID
>>                    Wscript.Echo "-- File System:     " &
>> objDisk.FileSystem
>>                    Wscript.Echo "-- Disk Size:       " &
>> FormatNumber(objDisk.Size, 0)
>>                    Wscript.Echo "-- Free Disk Space: " &
>> FormatNumber(objDisk.FreeSpace, 0)
>>                Next
>>            End If
>>        Else
>>            Wscript.Echo strServer & " not available"
>>        End If
>>    End If
>> Loop
>>
>> ' Clean up.
>> objFile.Close
>> If (objFSO.FileExists(strTempfile) = True) Then
>>    objFSO.DeleteFile(strTempFile)
>> End If
>>
>> Function IsConnectible(ByVal strHost, ByVal intPings, ByVal intTO)
>>    ' Returns True if strHost can be pinged.
>>    ' Based on a program by Alex Angelopoulos and Torgeir Bakken.
>>    Dim objFile, strResults
>>
>>    If (intPings = "") Then
>>        intPings = 2
>>    End If
>>    If (intTO = "") Then
>>        intTO = 750
>>    End If
>>
>>    Const OpenAsDefault = -2
>>    Const FailIfNotExist = 0
>>    Const ForReading = 1
>>
>>    objShell.Run "%comspec% /c ping -n " & intPings & " -w " & intTO _
>>        & " " & strHost & ">" & strTempFile, 0, True
>>
>>    Set objFile = objFSO.OpenTextFile(strTempFile, ForReading, _
>>        FailIfNotExist, OpenAsDefault)
>>    strResults = objFile.ReadAll
>>    objFile.Close
>>
>>    Select Case InStr(strResults, "TTL=")
>>        Case 0
>>            IsConnectible = False
>>        Case Else
>>            IsConnectible = True
>>    End Select
>> End Function
>> =====
>> This should be run from a command prompt using cscript. The output can be
>> redirected to a text file. The text file should have the NetBIOS names of
>> the computers, one per line. Change the name and path of this file to
>> suit your situation.
>>
>> --
>> Richard Mueller
>> MVP Directory Services
>> Hilltop Lab - http://www.rlmueller.net
>> --
>>
>>
>
>
Author
9 Jul 2009 11:54 AM
SimeonD
I had a similar requirement last month. I had started to script it, but
found that Spiceworks did what I was looking for.
Its free. Will check the disks as often as you require. Then allows you to
write a report on it. There are some built in reports do, will probably do
what you need.
Comes with some fancy charts that you can use, but I prefer just seeing the
values.

SimeonD

Show quoteHide quote
"Eldingo" <eldi***@dingo.net> wrote in message
news:%236aumhCAKHA.528@TK2MSFTNGP03.phx.gbl...
> Hello friends:
>
> Is there a way to get a report on disc space usage on all the servers in
> the domain. I need to do report on disc space availability on a monthly
> basis. Appreciate your help.
>
> -ciao
>