Perform a Basic o365 Inventory with PowerShell

An old customer wanted an insight into a little used o365 test tenant. I made sure they had a Global Admin account available, told them to download the Azure Active Directory cmdlets and then supplied them with following very basic 'script'.


Get-MsolAccountSku >> AAD.txt

Get-MsolSubscription >> AAD.txt

Get-MsolDomain >> AAD.txt

Get-MsolAdministrativeUnit -All >> AAD.txt

Get-MsolCompanyInformation >> AAD.txt

Get-MsolContact >> AAD.txt

Get-MsolDevice -All >> AAD.txt

Get-MsolDirSyncConfiguration >> AAD.txt

Get-MsolDomainFederationSettings -DomainName <your_cloud_domain_name> >> AAD.txt

Get-MsolDomainVerificationDns -DomainName <your_cloud_domain_name> >> AAD.txt

Get-MsolGroup >> AAD.txt

Get-MsolPartnerInformation >> AAD.txt

Get-MsolPasswordPolicy -DomainName <your_cloud_domain_name> >> AAD.txt

Get-MsolRole >> AAD.txt

Get-MsolRole | % {Get-MsolRoleMember -RoleObjectId $_.ObjectId} >> AAD.txt

Get-MsolUser >> AAD.txt

Get-MsolUserByStrongAuthentication >> AAD.txt


After supplying an appropriate credential to Connect-MsolService, the script then performs a bunch of gets and uses the append redirection operator to add the collected information to a text file called AAD.txt.

This text file can then be reviewed to gain an insight into the targeted tenant. That's it - no frills, no bling.

Of course, this rather rudimentary report can be supplemented with information gleaned from the Reports section of the o365 Admin portal.



AND, you can also generate these portal reports (and more) with PowerShell!

Use Windows PowerShell to create reports in Office 365


More to follow...


Comments (1)

Skip to main content