Hello,
I would like to use shell Script to run powershell scripts on Exchange 2007/2010 to check the database size, it this possible with Hostmonitor 8.06?
Thanks for your reply
With Regards,
Jan-Rinze
Powershell Support Hostmonitor 8.06
HostMonitor 8.06? No.
This option was implemented in version 8.14
http://www.ks-soft.net/hostmon.eng/news.htm#v814
How To Check Exchange Database Size with PowerShell
http://www.mikepfeiffer.net/2010/05/qui ... owershell/
Regards
Alex
This option was implemented in version 8.14
http://www.ks-soft.net/hostmon.eng/news.htm#v814
How To Check Exchange Database Size with PowerShell
http://www.mikepfeiffer.net/2010/05/qui ... owershell/
Regards
Alex
BTW
Script for Exchange 2007 may look like
There are 2 parameters:
1) MailBoxThreshold (in MB)
2) hostname\database_name
Start command: powershell.exe %Script% %Params%
Regards
Alex
Script for Exchange 2007 may look like
Code: Select all
$statusOk = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
$statusUnknown = "scriptRes:Unknown:"
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
$id=$args[1]
if ($args.count -lt 1) {
echo $statusUnknown" parameters required: <MailBoxThreshold in MB> [<hostname\database name>]"
exit
}
if ($args.count -eq 1) {$id="*"}
$mboxes = Get-MailboxDatabase -identity $id | foreach-object {add-member -inputobject $_ -membertype noteproperty -name mailboxdbsize -value ([math]::Round(([int64](get-wmiobject cim_datafile -computername $_.server -filter ('name=''' + $_.edbfilepath.pathname.replace("\","\\") + '''')).filesize / 1MB),2)) -passthru}
$mbtotal=0
foreach ($mbox in $mboxes) {
$mbtotal=$mbtotal+$mbox.mailboxdbsize
}
$d1 = $args[0] -as [decimal]
$d2 = $mbtotal -as [decimal]
if ($d2 -gt $d1)
{
echo $statusOk$d2" MB "$id
}
else
{
echo $statusBad$d2" MB "$id
}
1) MailBoxThreshold (in MB)
2) hostname\database_name
Start command: powershell.exe %Script% %Params%
Regards
Alex