Saturday, February 4, 2023

Microsoft 365 Discovery Report

If you are working with a Microsoft 365 tenant, whether it is for your own or for a client, it is often necessary to obtain a decent report of what is there. You may want to know about all the Mailboxes that are in Exchange Online, Delegate information, Licenses, a full listing of Microsoft Teams with members and data sizes, OneDrive sizes/usage, Distribution Lists, Contacts, Guest Accounts and SharePoint sites/data/usage. Lastly it also collects MFA details, showing who has it enforced, who has registered for MFA and the type of authentication (App/Txt/Call) that they selected, and the last logon date/time.

Getting all that information can involve a load of different scripts and console items to view which is why I have put it all together into a single script. The script runs across the tenant and creates multiple CSV files with all the data, then it compiles everything into a single Excel sheet with multiple tabs, all formatted and looking nice.

Update 29 December 2022

Updated version to 4.44. Now includes a Teams Channel report showing the granular membership of all channels, private/standard/shared, with the respective members and owners. Also fixed an error whereby EXO-Mailbox returns ‘0’ mailboxes due to ‘Alias’ error in script.

The Output

Here is an example of the output you can expect.

The script checks for all the modules that are required and prompts to install them if they are not present. There is no need to connect to M365 before running as it allows you to enter the credentials and make the connection at runtime.

Everything is run from a simple menu to make it easy to get the output you need.

After running, the C:\Scripts directory will look something like this.

Important Notes

I do have some important notes and comments about things that you should take a look at before you dive in.

  • The script is designed to run in the C:\Scripts directory on your machine. Use line #19 if you want to change it
  • In the menu, before you run it, use option #1 to enter the credentials, then option #2 to enter the tenant prefix. If you want to, you can use lines #34 – #39 to hardcode the credentials. This is useful if you want to keep running it for different things and don’t want to have to keep typing in credentials.
  • On line #15 I have suppressed the status bar. This is because some of the reports that come out of Teams generate a progress bar in the PS Cmdlet it calls, meaning sometimes you can get overlays of 6-7 progress bars which is just simply annoying. Up to you if you want to use this option.
  • The spreadsheet is only created when using the ‘Z’ option which runs ALL the reports sequentially.

If it is taking too long in your tenant and you want to scope the users in the mailbox reports then use lines #371 and #382 in place of the ‘get’ calls earlier and specify a unique query to cull the list down a bit.

To get this script download for free, subscribe to my YouTube channel and then drop me an email to [email protected] and I will send you a coupon code for a 100% discount.

Hope you find this useful, please reach out in the comments with any thoughts, comments or improvements you would like to see.

Mark – The Cloud Geezer.

Mark Rochester
Mark Rochester
Mark currently works in the cloud space assisting large companies to migrate from either on premises to the cloud, or cloud to cloud. His experience with Enterprise migrations spans more than 25 years which basically makes him old. However, with all the oldness creeping up he still finds technology massively exciting. Please reach out for a chat anytime you would like. :-)

Related Articles

Migrate Microsoft Teams using MigrationWiz

As there is no native way to migrate the content from Tenant to Tenant for Microsoft Teams we need to use a paid toolset...

Migrate Microsoft 365 Tenant to Tenant with Free Native Tools

An interesting topic again, debating whether the free native tools that are available to migrate the Exchange Online workload in Microsoft 365 are good...

Create ‘Dummy Test’ Users in Local Active Directory

The need for this comes along when you are testing things like Azure AD Connect Sync, or an AD to AD migration. Maybe an...

Stay Connected

- Advertisement -

Latest Articles