Active Office | 365 Cmd

Legacy modules ( MSOnline , AzureAD , ExchangeOnlineManagement older versions) are as of 2024–2026. 3. Interesting Active Commands (Live Examples) 3.1 User Reconnaissance – Find "Hidden" Accounts List all users who have never logged in (inactive security risk):

# 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: active office 365 cmd

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 Final command to try right now: Connect-MgGraph -Scopes

sayer headshot

Amber Sayer, MS, CPT, CNC

Senior Running Editor

Amber Sayer is a Fitness, Nutrition, and Wellness Writer and Editor, as well as a NASM-Certified Nutrition Coach and UESCA-certified running, endurance nutrition, and triathlon coach. She holds two Masters Degrees—one in Exercise Science and one in Prosthetics and Orthotics. As a Certified Personal Trainer and running coach for 12 years, Amber enjoys staying active and helping others do so as well. In her free time, she likes running, cycling, cooking, and tackling any type of puzzle.

Want To Save This Guide For Later?

Enter your email and we'll give it over to your inbox.