Listen to this Post
Roy Klooster has developed a powerful PowerShell tool to simplify Microsoft 365 license tracking by generating interactive HTML reports. This tool eliminates the need for manual spreadsheet management and provides administrators with enhanced visibility into license assignments, user status, and expiration alerts.
Key Features:
- Complete license visibility โ Track all Microsoft 365 licenses in one place.
- User status monitoring โ Identify active, inactive, or disabled users.
- Expiration alerts โ Get notified before licenses expire.
- Rich filtering capabilities โ Customize reports based on specific needs.
- Multiple export formats โ Export data in various formats for further analysis.
- Customizable appearance โ Adjust the reportโs look and feel.
Installation & Execution:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force Install-Script -Name Generate-M365LicenseAssignmentReport -Scope CurrentUser -Force Generate-M365LicenseAssignmentReport.ps1
Download & Full Details:
๐ PowerShell Gallery
๐ Full Documentation
You Should Know:
PowerShell Commands for Microsoft 365 Management
1. List All Licensed Users:
Get-MsolUser | Where-Object { $_.isLicensed -eq $true } | Select-Object UserPrincipalName, Licenses
2. Check License Expiration:
Get-MsolAccountSku | Select-Object AccountSkuId, ActiveUnits, ConsumedUnits
3. Export Users with Specific Licenses:
Get-MsolUser -All | Where-Object { $_.Licenses.AccountSkuId -eq "tenant:ENTERPRISEPACK" } | Export-Csv -Path "O365_Enterprise_Users.csv" -NoTypeInformation
4. Disable Inactive Users:
$inactiveUsers = Get-MsolUser -All | Where-Object { $_.LastLogonTime -lt (Get-Date).AddDays(-90) } $inactiveUsers | Set-MsolUser -BlockCredential $true
5. Automate Report Generation (Using Royโs Tool):
Generate-M365LicenseAssignmentReport -OutputPath "C:\Reports\LicenseReport.html" -Theme Dark
6. Check PowerShell Version (Compatibility Check):
$PSVersionTable.PSVersion
7. Uninstall Old Modules:
Uninstall-Module -Name OldLicenseModule -Force
What Undercode Say:
Managing Microsoft 365 licenses manually is error-prone and time-consuming. Roy Kloosterโs PowerShell tool automates this process, providing a dynamic HTML report for better decision-making. By integrating PowerShell commands, admins can further automate user management, license tracking, and compliance checks.
For cybersecurity professionals, PowerShell remains a critical tool for automating tasks in Windows environments. Combining such scripts with security best practices (like restricting execution policies) ensures efficiency without compromising security.
Expected Output:
- Interactive HTML report displaying license assignments.
- Filtered lists of active/inactive users.
- Alerts for near-expiration licenses.
- Exportable data in CSV/HTML formats.
For more PowerShell automation scripts, check:
๐ Microsoft Docs – PowerShell for M365
References:
Reported By: Roy Klooster – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass โ