Найти почтовые ящики с переадресацией почты в Exchange

 Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Select Name, PrimarySMTPAddress, ForwardingAddress, DeliverToMailboxAndForward

################################### # Exchange Mailbox_Forwarding.ps1 # # Created By mel9484 # # Date : 03/22/13 # ################################### $Header = "<h1><center>Mailboxes with Forwarding Address</center></h1>" $filehtml = "C:\Forwarding_Report.html" #Define CSS for the HTML Report $CSS = "<style type=`"text/css`"> TABLE{ direction:LTR; border-collapse:collapse; border-style: solid; border-width: 2px; border-Color: Black; font-family: Calibri; } td{ direction: LTR; border-style: solid; border-width: 2px; border-Color: Black; font-family: Calibri; background-repeat: no-repeat; background-position: center; } th{ border-style: solid; border-width: 2px; border-color: Black; background-color: Yellow; } body { font-family: Calibri; background-repeat: no-repeat; background-position: top right; } </style>" $Data = Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Select Name, @{Expression={$_.ForwardingAddress};Label="Forwarded To"}, @{Expression={$_.DeliverToMailboxAndForward};Label="Mailbox & Forward"}, @{n="Size(MB)";e = {$stat = Get-MailboxStatistics $_.name ; $stat.totalItemsize.value.toMB()}},@{n="Item Count"; e = {$stat = Get-MailboxStatistics $_.name ; $stat.itemcount}}, @{n="Last Logon Time"; e = {$stat = Get-MailboxStatistics $_.name ; $stat.lastlogontime}} $Data | ConvertTo-HTML -body $Header -Head $CSS | Out-File $filehtml Invoke-item $filehtml


Комментарии

Популярные сообщения из этого блога

У вас нет прав для отправки сообщения вместо указанного пользователя. Ошибка: [0x80070005-0x0004dc-0x000524]

Поиск и удаление писем в ящиках Exchange Server

KSMG Подготовка конфигурационных файлов для подключения к LDAP