This monitor determines if the number of available of M365 licenses is greater than the set thresholds.
This monitor verifies that number of available licenses for a particular SKU is greater than the set threshold. The “License Verification Profile” is used to run the workflow. This monitor has three health states, healthy, warning and critical. The health state is determined
by running the Get-AzureADSubscribedSku and then we need to make sure we actually have a license to assign. To determine that, we take the value of PrePaidUnits property (25) and subtract the value of the ConsumedUnits (24) property:
25 - 24 = 1
The PrePaidUnits property tells us how many licenses we’ve purchased, and the value ConsumedUnits tells us how many licenses are currently in use. If we subtract the number of licenses already spoken for from the number of licenses we purchased, we’ll know how many licenses are still available.
An error state is caused by having issues with connecting to Microsoft 365, fetching data or if available licenses are insufficient. It can be caused by the following:
Issues with global connection to Microsoft 365.
Credentials for Microsoft 365 subscription are not correct.
Microsoft 365 subscription not allowed to get data from Microsoft 365.
Available license counts are less than the warning or error thresholds.
Resolution depends on the specific error. Verify and/or fix the following:
Connectivity to Microsoft 365, including firewall and proxy settings.
Credentials for Microsoft 365 subscription may need to be changed or updated.
Update permissions for the Microsoft 365 subscription.
Adjust the warning or error thresholds.
Target | Microsoft.SystemCenter.M365.WatcherNodeApplication.Licensing | ||
Parent Monitor | Microsoft.SystemCenter.M365.Monitor.Availability.WatcherNode.Licensing | ||
Category | AvailabilityHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SystemCenter.M365.Monitor.LicenseCount.UnitMonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SystemCenter.M365.Monitor.LicenseCount" Accessibility="Public" Enabled="true" Target="Microsoft.SystemCenter.M365.WatcherNodeApplication.Licensing" ParentMonitorID="Microsoft.SystemCenter.M365.Monitor.Availability.WatcherNode.Licensing" Remotable="true" Priority="Normal" TypeID="Microsoft.SystemCenter.M365.Monitor.LicenseCount.UnitMonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.M365.Monitor.LicenseCount.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='Alert Message']$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Healthy" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
<OperationalState ID="Error" MonitorTypeStateID="Critical" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>14400</IntervalSeconds>
<AzureADEndpoint>$Target/Host/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication"]/AzureADEndpoint$</AzureADEndpoint>
<GraphEndpoint>$Target/Host/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication"]/GraphEndpoint$</GraphEndpoint>
<TenantId>$Target/Host/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication"]/TenantId$</TenantId>
<ApplicationClientId>$RunAs[Name="Microsoft.SystemCenter.M365.RunAsProfile.ApplicationClient"]/UserName$</ApplicationClientId>
<ApplicationClientCredentials>$RunAs[Name="Microsoft.SystemCenter.M365.RunAsProfile.ApplicationClient"]/Password$</ApplicationClientCredentials>
<SkuPartNumber>$Target/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication.Licensing"]/SkuPartNumber$</SkuPartNumber>
<CriticalThresholdPercentage>$Target/Host/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication"]/RemainingLicensesErrorPercentageThreshold$</CriticalThresholdPercentage>
<WarningThresholdPercentage>$Target/Host/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication"]/RemainingLicensesWarningPercentageThreshold$</WarningThresholdPercentage>
<MatchCount>1</MatchCount>
</Configuration>
</UnitMonitor>