📜  获取共享邮箱 powershell exchange 2010 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:43.507000             🧑  作者: Mango

代码示例1
$Mailboxes = Get-Mailbox -RecipientTypeDetails SharedMailbox
foreach ($Mailbox in $Mailboxes)
{
$Mailbox | Add-Member -MemberType “NoteProperty” -Name “MailboxSizeMB” -Value ((Get-MailboxStatistics $Mailbox).TotalItemSize.Value.ToMb())
$Mailbox | Add-Member -MemberType “NoteProperty” -Name “ItemCount” -Value ((Get-MailboxStatistics $Mailbox).ItemCount)
}
$Mailboxes | Sort-Object MailboxSizeMB -Desc | Select DisplayName,PrimarySMTPAddress,MailboxSizeMB,ItemCount,SamAccountName | Export-Csv -NoType “C:\Mailboxessize.csv”