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.
- Run the Windows Azure Active Directory Module for Windows PowerShell as Admin
- Run your initializing commands and enter the credentials for the Global Admin
$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
- As always I would first do this for one user and then for the entire tenant
- I will use my test user test123@spodawgs.gq and have his signature pull details from his details.
- I’ll add some of his details to the signature. You can add more if you like and pretty it up
- First let’s check via PowerShell if the Msol user Attributes display
Get-MsolUser -UserPrincipalName test123@spodawgs.gq | Select City,DisplayName,Office,PhoneNumber,StreetAddress,State
- As you can see in the screenshot below they do.
- I the run the following commands (all at once)
- I have highlighted the user name and the URL for the image logo so you can change it.
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}
- I have successfully set a signature for the user account test123
- Now let’s do this for the tenant
- To get the list of licensed users I ran the following command
Get-MsolUser | Where-Object { $_.isLicensed -eq “TRUE” }
- Change the properties accordingly to fit your needs
- I first ran the following command to set $x to licensed users with UPNs. Of course you can’t add a signature if there is no mailbox:
$x=Get-MsolUser | Where-Object { $_.isLicensed -eq “TRUE” } | Select-Object -property “UserPrincipalName”, “DisplayName”, “Title”, “Office”, “PhoneNumber”, “MobilePhone”, “Fax”
- After that I ran the command listed below to set a signature for all licensed users with mailboxes.
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}
- To prove that this works for the tenant let’s look at my signature:
Download Location:
Global Signature to all users in the Organization: https://gallery.technet.microsoft.com/scriptcenter/Update-Global-Signature-in-d8f2ae5b
Global Signature test for one user: https://gallery.technet.microsoft.com/scriptcenter/Add-Signature-to-one-user-d17cdea2