Link to home
Start Free TrialLog in
Avatar of Albert Widjaja
Albert WidjajaFlag for Australia

asked on

Modifying PowerShell script to list the Exchange Server 2013 Mailbox Database white space ?

Hi All,

Can anyone here please assist me in modifying the PowerShell script that used to work for Exchange Server 2007 but no anymore in Exchange Server 2013 ?
function Get-ExchangeWhiteSpace {
	param( 
	   $ComputerName = $(throw "ComputerName cannot be empty.") 
	)

	# Convert Dates to WMI CIM dates 
	$tc = [System.Management.ManagementDateTimeconverter] 
	$Start =$tc::ToDmtfDateTime( (Get-Date).AddDays(-1).Date ) 
	$End =$tc::ToDmtfDateTime( (Get-Date).Date)

	# Create two claculated properties for InsertionStrings values 
	$DB = @{Name="DB";Expression={$_.InsertionStrings[1]}} 
	$FreeMB = @{Name="FreeMB";Expression={[int]$_.InsertionStrings[0]}}

	Get-WMIObject Win32_NTLogEvent -ComputerName $ComputerName -Filter "LogFile='Application' AND EventCode=1221 AND TimeWritten>='$Start' AND TimeWritten<='$End'" | Select-Object ComputerName,$DB,$FreeMB | Sort-Object FreeMB –Unique –Descending
}

Get-ExchangeWhiteSpace -ComputerName "CCRClusteredMailboxName" | ft -AutoSize

Open in new window


I've tried this one but it doesn't work either: https://syscloudpro.com/2014/01/30/exchange-2007-database-white-space-report-2/

The script above was working to get the white space size within the mailbox database for all mounted database.

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Elango Sathyadev
Elango Sathyadev
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Albert Widjaja

ASKER

Yes.

Thanks !