Report License Assignment Scheduled
Generate and email a license availability report based on configured thresholds
Description
This runbook checks the license availability based on the transmitted SKUs and sends an email report if any thresholds are reached. Two types of thresholds can be configured. The first type is a minimum threshold, which triggers an alert when the number of available licenses falls below a specified number. The second type is a maximum threshold, which triggers an alert when the number of available licenses exceeds a specified number. The report includes detailed information about licenses that are outside the configured thresholds, exports them to CSV files, and sends them via email.
Runbook Customization
Setup regarding email sending
This runbook sends emails using the Microsoft Graph API. To send emails via Graph API, you need to configure an existing email address in the runbook customization.
This process is described in detail in the Setup Email Reporting documentation.
InputJson Configuration
Each license configuration requires:
SKUPartNumber (required): Microsoft SKU identifier
FriendlyName (required): Display name
MinThreshold (optional): Alert when available licenses < threshold
MaxThreshold (optional): Alert when available licenses > threshold
At least one threshold must be set per license.
Configuration Examples
Minimum threshold only (prevent shortages):
Maximum threshold only (prevent over-provisioning):
Both thresholds (maintain range):
Complete Runbook Customization
Finding SKU Part Numbers
Common SKUs:
ENTERPRISEPACK- Microsoft 365 E3ENTERPRISEPREMIUM- Microsoft 365 E5EMS- Enterprise Mobility + Security E3
Output
When violations detected:
Console output in job log
CSV export (
License_Threshold_Violations.csv)Email report with summary, violations, recommendations, and CSV attachment
When all within thresholds:
No email sent
Job completes successfully
Troubleshooting
SKU Not Found: Verify SKU exists using Get-MgSubscribedSku
Email Not Sent: Check EmailFrom configuration and Mail.Send permission
Invalid JSON: Validate JSON format before configuration
Migration Note
Legacy WarningThreshold automatically maps to MinThreshold - old configurations continue to work.
Location
Organization → General → Report License Assignment_Scheduled
Permissions
Application permissions
Type: Microsoft Graph
Organization.Read.All
User.Read.All
Mail.Send
Parameters
InputJson
JSON array containing SKU configurations with thresholds. Each entry should include:
SKUPartNumber: The Microsoft SKU identifier
FriendlyName: Display name for the license
MinThreshold: (Optional) Minimum number of licenses that should be available
MaxThreshold: (Optional) Maximum number of licenses that should be available
This needs to be configured in the runbook customization
Required
true
Default Value
Type
Object
EmailTo
Can be a single address or multiple comma-separated addresses (string). The function sends individual emails to each recipient for privacy reasons.
Required
true
Default Value
Type
String
EmailFrom
The sender email address. This needs to be configured in the runbook customization
Required
false
Default Value
Type
String
Last updated
Was this helpful?