The M365Documentation PowerShell module is extended with new incredible functions:
-
PowerShell 7
Support the execution on PowerShell 7 hosts.
-
MEM/Intune Settings Catalog
The settings catalog is growing and is used by more and more customers. Now, it can also be documented with my module.
Thank you @ylepine for the contribution to support Intune Settings catalog!
Additionally, a few bugfixes and smaller improvements were made. Not change is the list of supported systems which can be documented:
- Microsoft Endpoint Manager / Intune
- Azure AD
- Microsoft Cloud Print
- Microsoft Information Protection
- Windows 365 (CloudPC)
The Automatic Microsoft 365 Documentation PowerShell Module is available in the PowerShell Gallery and therefore its simple to install and use. You can just use these commands to create your first documentation:
Install-Module MSAL.PS
Install-Module PSWriteWord
Install-Module M365Documentation
# Connect to your tenant
Connect-M365Doc
# Collect information for component Intune as an example
$doc = Get-M365Doc -Components Intune -ExcludeSections "MobileAppDetailed"
# Output the documentation to a Word file
$doc | Write-M365DocWord -FullDocumentationPath "c:\temp\$($doc.CreationDate.ToString("yyyyMMddHHmm"))-WPNinjas-Doc.docx"
More and advanced use cases are documented on github: M365Documentation/AdvancedUsage.md
Feedback
Feedback is important to improve the solution in the future, therefore you can just submit feature requests or issues via Github Issues.
Principal Workplace Consultant | MVP at baseVISION AG
I’m a consultant, trainer and architect for modern workplace and enterprise mobility projects with Microsoft Technologies in the past eight years. I love to push and design the modern workplace based on Windows 10, EM&S and O365 for my customers which is the only answer for the current security threats, agile world and the fast-changing business requirements of my customers. Important for me is to simplify and automate the operational processes, because there are the highest costs.
Follow me
Latest posts by Thomas Kurth (see all)
- Microsoft Purview Information protect predefined permission groups demystified - February 28, 2023
- Extending Microsoft Sentinel with important device data - January 30, 2023
- SOC Monitor wall – Develop your Video Wall Application (Part 2) - August 22, 2022
6 Comments
Daniel · November 29, 2021 at 10:20
Hi Thomas,
I am a beginner in intune as well as IT Admin and have a task by my manager to document everything we have our Intune. Have started by installing all the packages that are in this page and everything went OK but I got stuck when I trying to connect to M365Doc.
I get this :Connect-M365Doc : The ‘Connect-M365Doc’ command was found in the module ‘M365Documentation’, but the module could not be loaded. For more information, run ‘Import-Module M365Documentation’
.
At line:1 char:1
+ Connect-M365Doc
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-M365Doc:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
Import-Module : File C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\internal\Assert-DirectoryExists.ps1 cannot be loaded because running scripts is disabled on this system. Fo
r more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ Import-Module M365Documentation
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [Import-Module], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
Any ideas ?
Thanks.
Thomas Kurth · January 28, 2022 at 22:15
This means that you have to allow scripts with set-executionpolicy before using the module. Perhaps an Admin has restricted PowerShell usage on your system.
trilochan Padhy · January 15, 2022 at 10:39
Hi Thomas,
I been using the same step which you have mentioned above, however getting below error while running : # Collect information for component Intune as an example
$doc = Get-M365Doc -Components Intune -ExcludeSections “MobileAppDetailed”
Invoke-DocGraph : The remote server returned an error: (400) Bad Request.
At C:\Program Files\WindowsPowerShell\Modules\M365Documentation\3.1.2\Internal\Collector\Intune\Get-MdmAdmxConfigurationProfile.ps1:24 char:17
+ … $Policies = Invoke-DocGraph -Path “/deviceManagement/groupPolicyConfi …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-DocGrap
Donovan · June 23, 2022 at 22:17
PS C:\intune> Install-Module MSAL.PS
PS C:\intune> Install-Module PSWriteWord
PS C:\intune> Install-Module M365Documentation
PS C:\intune> Connect-M365Doc
PS C:\intune> $doc = Get-M365Doc -Components Intune -ExcludeSections “MobileAppDetailed”
Used application does not have sufficiant permission to access: https://graph.microsoft.com/v1.0/organization
At C:\Program Files\WindowsPowerShell\Modules\M365Documentation\3.1.2\Internal\Helper\Invoke-DocGraph.ps1:51 char:13
+ throw “Used application does not have sufficiant permissi …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Used applicatio….0/organization:String) [], RuntimeException
+ FullyQualifiedErrorId : Used application does not have sufficiant permission to access: https://graph.microsoft.
com/v1.0/organization
PS C:\intune>
Asish Pasupuleti · November 11, 2022 at 06:27
Hi Thomas, I’m having the exact same issue as Donovan.
Thomas Kurth · November 11, 2022 at 12:11
Are you using a custom app registration in your tenant or the one which is used by default?
Because I verified the scopes which grant the permission are part of the definition.
DeviceManagementServiceConfig.Read.All,
DeviceManagementConfiguration.Read.All
https://learn.microsoft.com/en-us/graph/api/intune-onboarding-organization-list?view=graph-rest-1.0
Please verify if this permission is also part of you Enterprise App in Azure AD.