1

I have an Exchange 2010 environment. For Outlook (desktop version) we have a script setup in Group Policy to push out standardized signatures across the organization. I want to do the same for OWA, but

  1. I don't want to use transport rules, as users cannot see their signature at the time of writing the message. We'd like them to be able to see the signature
  2. There's lots of software that can do this, but we're trying to keep costs down.

If I used Set-MailboxMessageConfiguration, could data from Active Directory be pulled to make the signatures, given an exchange user ID? I know this way I'd have to run the script on a schedule to account for any updates and new users.

marcwenger
  • 235
  • 1
  • 6
  • 21

1 Answers1

2

I slowly managed to write a script that does what I need, and I'll share a sanitized version. For each mailbox, make assign their signatures - both text and HTML version. Depending on the phone types the user has, it makes their sigantures accordingly.

 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
}
marcwenger
  • 235
  • 1
  • 6
  • 21