iphase.dk Michael Mardahl, MVP
2 for 1 - Mail Enable Unlicensed Admin Accounts - 2024 Edition
Are you looking to cut mailbox licensing costs for your Office 365 tenants admin mail accounts? Well, look no further, and I will share a few ways for you to save money on Exchange Online licensing fees for your admin accounts that need to exchange e-mails.
_So what do I mean by "admin accounts"?_
In this case, the admin account (sometimes referred to as an ADM account) is a separate privileged account used by IT staff to perform their privileged duties. These account types are a standard security measure implemented in many companies, and in some cases, they need to be mail-enabled.
SOME VALID REASONS FOR NEEDING TO MAIL ENABLE AN ADMINS ACCOUNT IS:
* To receive Microsoft Notifications.
* Third-party admin tools that don't support alternative e-mail addresses.
* OTP messages sent to the account.
* Using the account UPN in places that require you to fill in an e-mail.
But mail enabling does not necessarily mean having to purchase a license for Exchange Online!
One way for you to avoid excessive licensing for Exchange Online is to redirect emails using Distribution Lists.
By redirection, I mean mail destined for your admin account goes to your regular non-privileged account instead.
>> IMPORTANT UPDATE
These solutions below worked for many years but are maybe no longer needed. A much simpler solution is now available to tenants that have "plus addressing" enabled. I have left the original part of this article below the line, just for historical reasons. The following is the "new" simple way of doing this. But notice that e-mail sent directly to the UPN will not be delivered, in this case you need to use one of the other options.
A "plus" address is simply a "tag" that is added to the incoming e-mail, but when added to the admin account, Entra ID will pass the check for duplicate mail address values, and allow you to add the "same" mail account to two different objects in Entra ID.
>> Enable Plus Addressing
Requirements: Exchange Administrator Role
To begin with, we need to verify if the tenant allows "Plus Addressing". It is enabled by default in most tenants, and you can read more about it here: Plus Addressing in Exchange Online | Microsoft Learn (https://learn.microsoft.com/en-us/exchange/recipients-in-exchange-online/plus-addressing-in-exchange-online?wt.mc_id=EM-MVP-5004117)
1. Access the Exchange Online Admin Center via https://admin.exchange.microsoft.com
2. In the menu on the left, find the "Settings" button, indicated by a "gear" icon, and click it.
3. Inside "settings", find the "Mail flow" option indicated by an envelope icon, and click it.
4. You should see a fan-out menu with the "plus addressing" option shown at the top. Make sure that the box next to it is clear. Clear it if needed.
>> Add a "plus" Address to the Admin Account
Adding a "plus" address to the admin account, so you receive e-mails in your "regular" mailbox, is as simple as these steps:
1. Go to the Microsoft Entra Portal: https://entra.microsoft.com
2. Find the user account in your list of users and open up the account page
3. Click on the "properties" tab found on the overview page.
4. Find the "Contact information" edit "pen" and click it.
5. Now simply type in your regular account e-mail but add the "plus" tag as well. For example, if your regular e-mail account is "[email protected]", add a "+admin" tag, right before the @-sign: [email protected]
6. Afterwards, click "save" and you are done!
Now you will receive e-mails on this address inside the normal user account mailbox. The added benefit of "plus" addressing is that you now have a tag that you can use to sort your e-mail on.
~~────────────────────────────────────────
>> Using Distribution Lists to redirect e-mail (Original Solution)
USING DISTRIBUTION LISTS TO REDIRECT E-MAIL HAS SEVERAL ADVANTAGES:
* Easy to set up with PowerShell or EAC.
* Redirect without storing a copy.
* Supports "send as" or "on behalf."
* Supports "Hide from Global Address List."
* Generates the least amount of system clutter.
* No license consumption required!
You might be wondering why this single problem had me choose Distribution Lists over other tried-and-true solutions? I explain that and other solutions, at the end of this article. It's up to you to decide if you think another solution is a better fit for your organization.
Now that most of the admin portals in Microsoft 365 and Azure no longer require admins to have an active license assigned, you could be looking into removing Exchange Online Licensing from your admin accounts and switching to Distribution List redirection or similar solutions to save money.
~~────────────────────────────────────────
>> The solution
I have opted into using PowerShell for this solution, but you could use the Exchange Admin Center instead. This is, however, not explained in this blog post.
The following PowerShell code should get you off to a good start. Use it to build a neat solution in Azure Automation, and have it execute every time you add a new admin account. That is sure to impress the boss!
Automation is king -- only your imagination will limit you...
>> The requirements
* Azure Subscription (free is sufficient). Alternatively, connect using the Exchange Online PowerShell Module V2.
* Exchange Online Administrator Privileges.
* A basic understanding of PowerShell script variables.
>> The steps
1. Log on to Azure Cloud Shell via HTTPS://SHELL.AZURE.COM (HTTPS://SHELL.AZURE.COM)
2. Run the command: CONNECT-EXOPSSESSION (UPDATE: removed in latest version of cloud shell, where you will have to install exchangeonlinemanagement PS module manually!)
After completing the above steps, you can interact with Exchange Online PowerShell.
BEFORE YOU GO OFF AND EXECUTE THE SCRIPT BELOW, YOU FIRST NEED TO UNDERSTAND THE VARIABLES THAT IT USES.
>> [powershell]
$adminMail = "[email protected]"
$userMail = "[email protected]"
$name = ($adminMail -replace "@","_").Replace(".","-")
New-DistributionGroup -Name "Redirect for $name" -Alias "$name`_admin" -PrimarySMTPAddress "$($adminMail)" -ManagedBy "$userMail" -CopyOwnerToMember -MemberDepartRestriction "Closed" -MemberJoinRestriction "Closed"
Set-DistributionGroup "Redirect for $name" -HiddenFromAddressListsEnabled $true -GrantSendOnBehalfTo "$userMail" -RequireSenderAuthenticationEnabled $false
YOU WILL NEED TO MODIFY THE VARIABLES IN THE SCRIPT ABOVE, ACCORDING TO YOUR REQUIREMENTS.
* $ADMINMAIL -- This variable is the e-mail address you wish to assign to the Distribution Group. This should be the same as the UPN address of the admin account.
* $USERMAIL -- This variable is the non-privileged account e-mail. This account must have an Exchange mailbox and should only belong to the same person owning the admin account if you like staying compliant.
* $NAME -- This variable is my way of auto-generating a name for the Distribution List; you can modify it if you like, but you must understand the impact yourself.
~~────────────────────────────────────────
>> Troubleshooting
* NO E-MAIL COMING THROUGH FROM THE INTERNET -- Unfortunately, it can take a while for your newly created Distribution Lists cleared for unauthenticated external e-mail. So, give it some time.
* ADMIN E-MAIL ADDRESS ALREADY IN USE IN THE ORGANIZATION? -- If you previously had this e-mail address receiving e-mail, you will need to track down the location of the e-mail attribute and remove it from whatever crevice it resides in -- e-mail addresses are unique throughout Exchange Online. Remember to back up any existing mail data _if you already had a license assigned to the admin account_. You might have leftover attributes from past licensing on your admin account. Clean them out by temporarily adding a license and running the Set-User [email protected] -PermanentlyClearPreviousMailboxInfo command from Exchange Online PowerShell. You are out of luck? -- delete the user and create from scratch.
* UNABLE TO REMOVE THE EXCHANGE ONLINE LICENSE FROM THE ADMIN ACCOUNT -- You might have group-based licensing (https://msendpointmgr.com/2020/03/17/microsoft-365-group-based-licensing-automated/) enabled in your tenant.
>> Other solutions -- pros/cons
As with all things Microsoft, there are several ways to achieve a solution to a problem, so in the spirit of sharing my thoughts, here are some other possible solutions.
_Please keep in mind that you might be required to adhere to specific compliance requirements, such as accountability, traceability, retention, backup licensing, exit strategies, and separation of privileges._
Security compliance is why I ended up choosing Distribution Lists. Also because they have the smallest footprint vs. usability.
>> Transport Rule
PROS:
* Requires no license.
* Easy to implement.
CONS:
* Can't use "Send As" and "On behalf of".
* Clutter in the rules list. Can you imagine having 99 admin accounts and this problem?
* You are limited to 300 rules in Exchange Online.
>> Shared mailbox
A classic solution to saving on Exchange Online licensing, but it did not support my requirements of not being able to store email -- it came close though!
PROS:
* Requires no license.
* Can store a hierarchy of mail items in folders.
* Easy to configure and maintain with PowerShell.
* Can have a very small visual footprint in the admin interface.
CONS:
* Requires a user account to be present and disabled for mailbox login.
* The admin UPN can only be added as a secondary Alias.
* Runs as a separate mailbox in Outlook, unless automapping is disabled and email is forwarded.
* Your mobile access to these emails will be limited to Outlook for iOS/Android.
>> Alias Address
Not much to say here. Except that it's not possible to assign an Alias to a regular user if the alias exists as a "UserPrincipalName" (UPN) on an existing account. Also if you have a Hybrid Exchange environment, you might be tempted to manipulate the user's proxyAddress attribute directly. This will not work!
>> Microsoft 365 Groups
Not much to say here either. Same limitations as Alias Address apply.
>> Final words
In a perfect world of P2 licensing, you could use Azure PIM to consolidate users. Unless security has required that you have separate accounts (tiering).
As always, I hope you find inspiration in this article. And I welcome any feedback in the comments or on X @michael_mardahl (https://twitter.com/michael_mardahl).
C:\IPHASE\POSTS\IDENTITY\2FOR1A~1.TXT
1 Help 3 Home 5 About 7 Posts 8 Contact 10 LinkdIn
imagevwr.exe