powershell commands exchange 2007

dostanete ve výstupu – jméno serveru , Storage groups , jméno , počet mailboxů v DB

Get-MailboxDatabase | Select Server, StorageGroupName, Name, @{Name=“Number Of Mailboxes“;expression={(Get-Mailbox -Database $_.Identity | Measure-Object).Count}} | Format-Table -AutoSize

převzato a odzkoušeno

http://exchangeshare.wordpress.com/2009/07/27/exchange-2007-database-statistics-in-powershell/

Velikost DB

Get-MailboxDatabase | Select Server, StorageGroupName, Name, @{Name=“Size (GB)“;Expression={$objitem = (Get-MailboxDatabase $_.Identity); $path = „`\`\“ + $objitem.server + „`\“ + $objItem.EdbFilePath.DriveName.Remove(1).ToString() + „$“+ $objItem.EdbFilePath.PathName.Remove(0,2); $size = ((Get-ChildItem $path).length)/1048576KB; [math]::round($size, 2)}}, @{Name=“Size (MB)“;Expression={$objitem = (Get-MailboxDatabase $_.Identity); $path = „`\`\“ + $objitem.server + „`\“ + $objItem.EdbFilePath.DriveName.Remove(1).ToString() + „$“+ $objItem.EdbFilePath.PathName.Remove(0,2); $size = ((Get-ChildItem $path).length)/1024KB; [math]::round($size, 2)}}, @{Name=“No. Of Mbx“;expression={(Get-Mailbox -Database $_.Identity | Measure-Object).Count}} | Format-table -AutoSize

velikost DB

[PS] C:\Documents and Settings\Administrator>$dbs = Get-MailboxDatabase -server
e ; $dbsizes=@{}; ForEach ($db in $dbs) {$file = Get-ChildItem $db.EdbFilePath;
$dbsizes.Add($db.Name,$File.Length)}; $dbsizes.GetEnumerator() | Sort-object Val
ue


Get-ToThePrompt -at PowerGUI.org

marwin se představuje:

IT Engineer Design, Implementation and Administration of Microsoft products. Active Directory and MS Exchange systems, Hyper-V, SCOM
Příspěvek byl publikován v rubrice Exchange Server / Exchange Online. Můžete si uložit jeho odkaz mezi své oblíbené záložky.