Forum Discussion
Cristian Ceobanu
Jul 31, 2019Copper Contributor
Get email alerts for low than 50 free Office 365 licenses
Hi all,
In my environment we have for the moment to SG who are entitled for 0ffice 365 licence. Is a dynamic environment and a few times we have been very closed to rich our total limit.
I’m locking for a option to send some alerts when the available licence number drops under a specific number
I’ve found a few tutorials but I couldn’t used them, not complete solutions.
https://techcommunity.microsoft.com/t5/Office-365/Office-365-license-consumption-alert/td-p/56036
- JanBakkerOrphanedSteel Contributor
Cristian Ceobanu Try this: https://janbakker.tech/use-power-automate-or-logic-apps-to-keep-an-eye-on-your-licenses/
no scripts, and you can work with percentage threshold and a specific number.
- KdshipsCopper Contributor
Cristian Ceobanu, this is probably what you are looking for. https://insterswap.wordpress.com/2020/03/29/automatically-alert-your-team-when-your-tenant-is-running-low-or-out-of-office-365-license/
Depending on how big or complicated your environment is, the script may require a little modification. Our need was just as simple as “tell us when our license is low or out”. As the saying goes, necessity is the mother of invention. Feel free to modify the script.
- Hemat MaheshwariBrass Contributor
You can simply use below logic - Get the number of consumed units and based on the consumption call email alert. You can extend below logic for your script by adding some error handling and email function.
Change the tenant name and sku type - you want to monitor
$GetConsumedUnits=(Get-MsolAccountSku | where {$_.AccountSkuId -eq "tenant:ENTERPRISEPACK"}) | Select-Object ConsumedUnits
If ($GetConsumedUnits.ConsumedUnits -gt xx)
{
Call Email Alert Function
}Cheers,
H,
- AusSupport180Brass ContributorHi Hemat Maheshwari
I'm schedule to run weekly and send an email.
Get-MsolAccountSku | select ActiveUnits, ConsumedUnits, @{n='AvailableUnits';e={($_.ActiveUnits - $_.ConsumedUnits)}}, AccountSkuId
But how do i email only Availableunit under 5 ?- SimBur2365Brass ContributorHi, here is a script you can run from Azure Automation... you can now also create a free sendgrid account directly in Azure Solutions to call from a runbook. Cheers 😃
https://www.howdoiuseacomputer.com/index.php/2021/09/12/azure-microsoft-365-licensing-alert/
- Cristian CeobanuCopper Contributor
Thanks Hemat, i will start to do some test right now :).
It's easy to do with PowerShell, what exactly is not working for you in the proposed solutions? You need one call of Get-MsolAccountSku, a simple if statement and then an email action. There's no need for azure functions or Flows or anything.
- Cristian CeobanuCopper Contributor
VasilMichevHi Vasil, indeed the first part is true Get-MsolAccountSku work fine but the second part is not easy to achieve and I couldn't make the script to work, check if number is smaller than x and then send a email.