Global Signature

A global signature is like a regular signature however it’s managed by your company. This is not a disclaimer that gets appended towards the end of every email. I have gotten a lot of requests to have a global signature so here goes.

This signature will pull attributes from the user profile (MsolService | Office 365) and apply it on the Mailbox (Exchange Admin Center). So let’s first connect to the EAC (Exchange Admin Center) and Office 365 via PowerShell.

$LiveCred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $LiveCred -Authentication Basic -AllowRedirection

Net start winrm

set-executionpolicy unrestricted -force

Import-PSSession $Session

Connect-MsolService

Get-MsolUser -UserPrincipalName test123@spodawgs.gq | Select City,DisplayName,Office,PhoneNumber,StreetAddress,State

foreach($user in (Get-MsolUser -userprincipalname test123@spodawgs.gq)){

$DisplayName=$user.DisplayName;

$Title=$user.Title;

$Street=$user.StreetAddress;

$Office=$user.Office;

$PhoneNumber=$user.PhoneNumber;

$MobilePhone=$user.MobilePhone;

$Fax=$user.Fax;

$Email=$user.UserPrincipalName;

$pic= “<div><font size=’4′><b>$displayname</b></font><br>

<font color=’#000000′ size=’2′>Title: $Title</font><br>

<font color=’#000000′ size=’2′>Office: $Office</font><br>

<font color=’#000000′ size=’2′>Phone: $PhoneNumber</font><br>

<font color=’#000000′ size=’2′>Mobile: $MobilePhone<br>

<font color=’#000000′ size=’2′>Fax: $Fax<br>

<font color=’#0000FF’ size=’2′>Email:<a href=mailto:$Email>$Email</a><br>

<img src=’http://www.microsoft.com/favicon.ico?v2′ height=’25’ width=’25’></div>”

Set-MailboxMessageConfiguration -Identity $user.UserPrincipalName -AutoAddSignature $True -Signaturehtml $pic -defaultfontflag ALL -defaultformat HTML}

Get-MsolUser | Where-Object { $_.isLicensed -eq “TRUE” }

$x=Get-MsolUser | Where-Object { $_.isLicensed -eq “TRUE” } | Select-Object -property “UserPrincipalName”, “DisplayName”, “Title”, “Office”, “PhoneNumber”, “MobilePhone”, “Fax”

ForEach($user in ($x))

{

$DisplayName=$user.DisplayName;

$Title=$user.Title;

$Street=$user.StreetAddress;

$Office=$user.Office;

$PhoneNumber=$user.PhoneNumber;

$MobilePhone=$user.MobilePhone;

$Fax=$user.Fax;

$Email=$user.UserPrincipalName;

$pic= “<div><font size=’4′><b>$displayname</b></font><br>

<font color=’#000000′ size=’2′>Title: $Title</font><br>

<font color=’#000000′ size=’2′>Office: $Office</font><br>

<font color=’#000000′ size=’2′>Phone: $PhoneNumber</font><br>

<font color=’#000000′ size=’2′>Mobile: $MobilePhone<br>

<font color=’#000000′ size=’2′>Fax: $Fax<br>

<font color=’#0000FF’ size=’2′>Email:<a href=mailto:$Email>$Email</a><br>

<img src=’http://www.microsoft.com/favicon.ico?v2′ height=’25’ width=’25’></div>”

Set-MailboxMessageConfiguration -Identity $user.UserPrincipalName -AutoAddSignature $True -Signaturehtml $pic -defaultfontflag ALL -defaultformat HTML}