You can also try this one:

http://gsexdev.blogspot.com/2008/07/show-exchange-whitespace-retained-it
ems.html

I use something based on this in PowerGUI.

Cheers,

Phil

--
Phil Randal | Networks Engineer
NHS Herefordshire & Herefordshire Council  | Deputy Chief Executive's
Office | I.C.T. Services Division
Thorn Office Centre, Rotherwas, Hereford, HR2 6JT
Tel: 01432 260160
email: pran...@herefordshire.gov.uk

Any opinion expressed in this e-mail or any attached files are those of
the individual and not necessarily those of Herefordshire Council.

This e-mail and any attached files are confidential and intended solely
for the use of the addressee. This communication may contain material
protected by law from being passed on. If you are not the intended
recipient and have received this e-mail in error, you are advised that
any use, dissemination, forwarding, printing or copying of this e-mail
is strictly prohibited. If you have received this e-mail in error please
contact the sender immediately and destroy all copies of it.
-----Original Message-----
From: Kleciak, Clint D A7IT [mailto:clint.klec...@cigna.com] 
Sent: 23 July 2010 15:36
To: MS-Exchange Admin Issues
Subject: RE: Exchange 2003 whitespace

Powershell Script I wrote\stole.  Works in Ex2007 with Powershell 2.0.
It needs some modifications on the order of application entries it
brings into the array but it will get you going.




#////startscript

#Need Power Shell Version 2.0

# Note: Event ID 1221 has an InstanceID of 1074136261 on both MSX 2007
and MSX 2003 servers. 
#
#########Vairables#############
# $es = Servers Array         #
# $srv = Servername           #
# $dbc = Database Count       #
# $DB = Database Name         #
# $WS = WhiteSpace            #
###############################


#Create File for Output
$fileName=read-host "Enter the File Name where the information will be
stored:"
$File=New-Item -ItemType file "$FileName.txt"

#Adds Header Info to file
add-content $file Server"       "DateBase"      "NumberOfUsers"
"DataBaseSize"  "WhiteSpace


#Gets All Exchange Servers with the Mailbox Role including Public
Folders $es = Get-ExchangeServer | Sort-Object -Property name |
Where-Object {$_.ServerRole -eq "Mailbox"}

 

foreach ($srv in $es)
{
#Getting the database count
$dbc = get-mailboxdatabase -server $srv |Measure-Object


#Getting the 1221 events. 
#need to modify the following line in order to only get correct app
entries $events = Get-EventLog -ComputerName $srv -LogName application
-instanceid 1074136261 -source "MSExchangeIS Mailbox Store" -Newest
$dbc.count| Sort-Object -Property Message 

#Writing the output to Screen
Write-Host "" 
Write-Host "Server -" $srv -ForegroundColor Blue Write-Host "Databases
-" $dbc.Count -ForegroundColor Blue Write-Host "" 


foreach ($item in $events)
{
$DBName = $item.ReplacementStrings[1]
$WS = $item.ReplacementStrings[0] 


$database1=$DBName

        #Getting File Size of Databases
        $db = Get-MailboxDatabase $srv"\"$Database1
        #write-host $db
        $path = "`\`\" + $srv + "`\" +
$db.EdbFilePath.DriveName.Remove(1).ToString() + "$"+
$db.EdbFilePath.PathName.Remove(0,2)
        
                $dbsize = Get-ChildItem $path
                $ReturnedObj = New-Object PSObject
                #$ReturnedObj | Add-Member NoteProperty -Name
"Server\StorageGroup\Database" -Value $objItem.Identity
                #$ReturnedObj | Add-Member NoteProperty -Name "Size
(MB)" -Value ("{0:n2}" -f ($dbsize.Length/1024KB))
                #$ReturnedObj | Add-Member NoteProperty -Name " " -Value
("{0:n2}" -f ($dbsize.Length/1024KB))

                $ReturnedOBJ = ("{0:n2}" -f ($dbsize.Length/1024KB))
                
                
                
#Getting Number of Users on Databases           
$NuUsers=Get-MailboxStatistics -database $srv"\"$Database1 |where-object
{!$_.DisconnectDate} | group-object -property:displayName
|Measure-Object $NumBerOfUSers=$NuUsers.Count

#Writing to Screen      
        Write-Host
        Write-Host "ServerName  "$srv
        Write-Host "DBName      "$DBName
        write-host "NmbrUsers   "$NumberOfUsers
        Write-Host "SizeOfDB    "$ReturnedObj
        Write-Host "WhtSpace    "$WS
        Write-Host

#Writing to File        
add-content $file $srv" "$DBName"       "$NumberOfUsers"
"$ReturnedObj"  "$WS


}
}



#////endscript





_______________________________________ 
Clint Kleciak
Infrastructure Engineer Mgr
CIGNA IT

Confidential, unpublished property of CIGNA. Do not duplicate or
distribute. Use and distribution limited solely to authorized personnel.
(c) Copyright 2010 CIGNA

-----Original Message-----
From: Ellis, John P. [mailto:johnel...@wirral.gov.uk] 
Sent: Friday, July 23, 2010 5:02 AM
To: MS-Exchange Admin Issues
Subject: Exchange 2003 whitespace

Is it possible to obtain free disc space, EDB size, and white space from
the command line and export it to a file?

Thanks
John
-------------------------------------------------------------------

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.clearswift.com
**********************************************************************







------------------------------------------------------------------------
------
CONFIDENTIALITY NOTICE: If you have received this email in error, please
immediately notify the sender by e-mail at the address shown.  This
email transmission may contain confidential information.  This
information is intended only for the use of the individual(s) or entity
to whom it is intended even if addressed incorrectly.  Please delete it
from your files if you are not the intended recipient.  Thank you for
your compliance.  Copyright 2010 CIGNA
========================================================================
======



Any opinion expressed in this e-mail or any attached files are those of the 
individual and not necessarily those of Herefordshire Council.
You should be aware that Herefordshire Council monitors its email service.
This e-mail and any attached files are confidential and intended solely for the 
use of the addressee. This communication may contain material protected by law 
from being passed on. If you are not the intended recipient and have received 
this e-mail in error, you are advised that any use, dissemination, forwarding, 
printing or copying of this e-mail is strictly prohibited. If you have received 
this e-mail in error please contact the sender immediately and destroy all 
copies of it.


Reply via email to