I have just published a tool (PowerShell script) on github to create a comprehensive documentation of a tenant and also export all settings in JSON format that can also be used for importing settings again in the same tenant or even another. This can be very useful in a scenario where there is a DEV-tenant and then a production tenant to make sure the settings are the same in both.
The script and a more detailed documentation of how to use it can be found here:
https://github.com/matbe/MEMDocumentAndExporter
The script makes use of a PowerShell module called "PSWriteWord" which enabled the creation of nice-looking word documents with TOC, tables, hyperlinks etc.
The script uses a word template to create the final documentation, this file can be customized by the user to suit their needs.

The words "#TENANT#,#DATE#,#USERNAME#" are dynamically updated when the script is run.

Each setting documented also includes where that specific object is assigned. It can also document who did the last change (optional). If export is enable it also includes a link to the exported JSON-file.

If you find any bugs or have any requests please create an issue on the github page.
Hope you find it useful, if you do please let me know 🙂
/Matt
Twitter: matbg
Hi ,
What does static client id value refer to?
$clientId = "d1ddf0e4-d672-4dae-b554-9d5bdfd93547"
Hi, that is the ID of the "Microsoft Intune PowerShell" Application, see this post and especially the comment from MihaiLA for more information.
https://techcommunity.microsoft.com/t5/intune-customer-success/support-tip-getting-started-with-microsoft-graph-api/ba-p/364257
Hi there. Trying (as global admin), but am getting "Get-GraphUri : Request to https://graph.microsoft.com/Beta/deviceAppManagement/mobileApps failed with HTTP Status Unauthorized Unauthorized" messages. any help would surely be appreciated! Thanks Mattias!
Hi Garth,
I am unable to reproduce the issue unfortunately. It works without any errors for me, do you get an error on all apps or just some? If just some, please file a bugreport on github with instructions how to replicate the issue and I will see what I can do. Are you using the latest version from Github? There was some errors related mobileApps in an older version but those should be fixed. https://github.com/matbe/MEMDocumentAndExporter
/Matt
Hi Matt. Better late than never to close the loop on this one. Thanks! WAS an older version, got the latest and we are golden. I DO have a question though and I'll post it on Git.. If an app/profile/etc is assigned to All users, it seems the script dumps a list of all the groups. Results in a HUGE doc.
Hi Mattias,
Thank you!
This is very helpfull for documenting. Before I used to generate jsons and csv files from PS. But this is a mutch more complete solution
I've been waiting for someone that knows how to script this for a year. Legend! You have enabled us techs to work and tick off the documentation aspect with a quicker turn around.
Thank you! Always happy when someone find my stuff useful 🙂
This is so cool , Great Job Matt !!!
This looks really great. I can see us definitely utilizing something like this in the future. Great job!
Thank you!
Awesome work Matt.
I was looking at this https://github.com/Micke-K/IntuneManagement and planning on extending it by creating a button that would use PSWriteWord to create word docs as well. May be something in there that you can use. Cheers
Thank you.
If there is anything you miss please create a issue/feature request and I will see what I can do!
Also feel free to create a pull request if you want, and help is appreciated!
/Matt