Exchange OWA 2010 签名策略

Exchange OWA 2010 签名策略

我有一个 Exchange 2010 环境。对于 Outlook(桌面版),我们在组策略中设置了一个脚本,用于在整个组织中推送标准化签名。我想对 OWA 执行同样的操作,但是

  1. 我不想使用传输规则,因为用户在撰写邮件时无法看到他们的签名。我们希望他们能够看到签名
  2. 有很多软件可以做到这一点,但我们正在努力降低成本。

如果我使用 Set-MailboxMessageConfiguration,给定交换用户 ID,是否可以从 Active Directory 中提取数据来制作签名?我知道这样我必须按计划运行脚本以考虑任何更新和新用户。

答案1

我慢慢地设法编写了一个可以满足我需求的脚本,我将分享一个经过净化的版本。对于每个邮箱,请分配他们的签名 - 文本和 HTML 版本。根据用户拥有的手机类型,它会相应地生成他们的签名。

 Import-Module ActiveDirectory
. 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1' Connect-ExchangeServer -auto
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010

$userList = get-mailbox -resultsize unlimited | where-object {$_.RecipientTypeDetails -eq "UserMailbox"} | sort-object alias

foreach($user in $userList)
{
    $ui = get-aduser $user.alias -properties *
    $telLine = ""
    $telLineHTML = ""
    $telLineText = ""

    if($ui.telephoneNumber -ne $null -and $ui.Mobile -ne $null -and $ui.Fax -ne $null){
        $telLine =  "Tel: " + $ui.telephoneNumber + " | Cell: " + $ui.Mobile + " | Fax: " + $ui.Fax
    }
    elseif($ui.telephoneNumber -ne $null -and $ui.Mobile -ne $null){
        $telLine =  "Tel: " + $ui.telephoneNumber + " | Cell: " + $ui.Mobile
    }
    elseif($ui.telephoneNumber -ne $null -and $ui.Fax -ne $null){
        $telLine =  "Tel: " + $ui.telephoneNumber + " | Fax: " + $ui.Fax
    }
    elseif($ui.telephoneNumber -ne $null){


$telLine =  "Tel: " + $ui.telephoneNumber
}
elseif($ui.Mobile -ne $null){
    $telLine =  "Cell: " + $ui.Mobile
}

if($telLine -ne "")
{
    $telLineHTML = $telLine + "<br>"
    $telLineText = $telLine + "`n"
}

$t = $ui.DisplayName + " | " + $ui.Title + "`n" + $ui.Company + "`n" + $ui.StreetAddress + ", " + $ui.City + ", " + $ui.State + ", " + $ui.PostalCode + "`n" + $telLineText + "Email: " + $ui.EmailAddress.ToLower()

$h = "<div style='font-family:Tahoma; font-size:13px'><span color='#041F3C' style='font-family:Calibri; font-size:10pt'><strong>" + $ui.DisplayName + " | </strong></span><span color='#F37021' style='font-family:Calibri; font-size:10pt'><strong><font color='#f37021'>" + $ui.Title + "</font></strong></span><br><span style='font-family:Calibri; font-size:10pt'>" + $ui.Company + "<br>" + $ui.StreetAddress + ", " + $ui.City + ", " + $ui.State + ", " + $ui.PostalCode + "<br>" + $telLineHTML + "Email: <a href='mailto:" + $ui.EmailAddress.ToLower() + "'>" + $ui.EmailAddress.ToLower() + "</a></span></div>"

    Set-MailboxMessageConfiguration $ui.SamAccountName -SignatureText $t -signatureHTML $h

    #get-MailboxMessageConfiguration $ui.SamAccountName | select SignatureText, SignatureHTML | format-list
}

相关内容