# Report summary Write-Output "=== O365 Health Report $(Get-Date) ===" Write-Output "Users: $(Get-MgUser -All).Count" Write-Output "Disabled users: $(Get-MgUser -All | Where-Object $_.AccountEnabled -eq $false).Count" Write-Output "Guest accounts: $(Get-MgUser -All | Where-Object $_.UserType -eq 'Guest').Count" Write-Output "Mailboxes > 90GB: $((Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Where-Object $_.TotalItemSize.Value.ToGB() -gt 90).Count)" Though limited, native cmd can still interact with O365 via curl to Graph API with a token:

Connect-MgGraph -Scopes "User.Read.All", "AuditLog.Read.All" Get-MgUser -All | Where-Object $_.SignInActivity -eq $null Uncovers service accounts, terminated employees not disabled, or shared mailboxes being used for illicit access. 3.2 License Audit – Who’s Wasting Money? Get-MgUser -All -Property Id,DisplayName,AssignedLicenses | Select-Object DisplayName, @N="Licenses";E=$_.AssignedLicenses.SkuId -join ", " | Where-Object $_.Licenses -ne "" Output: Every user with their assigned product SKUs. Run this weekly to catch ghost licenses. 3.3 Bulk Mailbox Actions (Like Old cmd but Powerful) Add "Legal Hold – Project X" to all members of a distribution group:

The "CMD" of yesterday has evolved into a programmable, powerful interface that gives you complete control over your tenant. Final command to try right now: Connect-MgGraph -Scopes "User.Read.All" Get-MgUser -Top 10 | Format-List DisplayName, UserPrincipalName End of Report

MediaWiki spam blocked by CleanTalk.