At SMEx we are all for using cloud based SaaS products. We use Office 365 and Azure AD to manage our users, and we use Exclaimer Cloud - Signatures for Office 365 to manage our email signatures.

The way Exclaimer works is that it reads profile info from Azure AD and generates a signature during message transport and applies it to the message. It's actually quite a neat solution.

At SMEx, we have three offices and we include the address of the office in the signature. So instead of creating three different signatures in Exclaimer, we wanted one signature that can pull the address from the user's profile attributes.

In AzureAD we put each user into an AD Group by office so we just need to update the same address for all users in a group. Now whilst Azure AD provides a nice UI for updating profile attributes, it can become tedious if you need to update many users. 


The solution was PowerShell and the AzureAD module

All you need to do is:

  1. Import the AzureAD powershell module using 
    1. Import-Module AzureAD
  2. Connect to Azure Active Directory using
    1. Connect-AzureAD
    2. This pops open a Microsoft Live login window
  1. Get a list of AD Groups and find the ID of the group to update
    1. Get-AzureADGroup
  1. Update the profile attribute for all users in the group (in this case we are updating the Department field)
    1. Get-AzureAdGroupMember -ObjectId "<Id of the group>" | ForEach-Object -Process { Set-AzureADUser -ObjectId $_.Mail -Department "New Address/Value here" }

Below is a Gist you can use. All you need to do is replace the GroupID and the value to update. If you want to update an attribute other than Department you can see the list of available attributes here