1

我需要使用 Exchange 命令行管理程序从 Exchange 2010 中导出用户免责声明。那可能吗?免责声明示例:

Kathleen Mayer
Sales Department
Contoso
www.contoso.com
kathleen@contoso.com
cell: 111-222-1234

我试过这个脚本,但它的结果不包含免责声明:

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010

try {
    Import-Module ActiveDirectory -ErrorAction Stop
}
catch {
    Write-Host "Unable to load Active Directory module, is RSAT installed?"
    Exit
}

$Results = foreach ($User in (Get-ADUser -Filter * -Properties Department, Mail)) {

    $Mailbox = Get-Mailbox $User.Name -ErrorAction SilentlyContinue

    if ($Mailbox) {
        $Mail = $Mailbox | Get-MailboxStatistics -ErrorAction SilentlyContinue

        if ($Mail.TotalItemSize.Value -eq $null) {
            $TotalSize = 0
        } else {
            $TotalSize = $Mail.TotalItemSize.Value.ToBytes()
        }

        New-Object PSObject -Property @{
            Name = $User.Name
            SamAccountName = $User.SamAccountName
            Email = $User.Mail
            Department = $User.Department
            MailboxSize = $TotalSize
            IssueWarningQuota = $Mailbox.IssueWarningQuota
            ProhibitSendQuota = $Mailbox.ProhibitSendQuota
            ProhibitSendReceiveQuota = $Mailbox.ProhibitSendReceiveQuota
        }
    }
}

$Results |
    Select Name, SamAccountName, Email, `
    Department, MailboxSize, IssueWarningQuota, `
    ProhibitSendQuota, ProhibitSendReceiveQuota |
    Export-Csv c:\MailboxSizeByDepartment.csv -NoTypeInformation

请参阅此链接:https ://technet.microsoft.com/en-us/library/dn600437%28v=exchg.150%29.aspx

4

0 回答 0