Microsoft 365 DSC


Working with Configurations

In contrast to exporting, importing a configuration is comparatively simple. After all, everything is already configured. The command is Start-DSCConfiguration and as an argument, you will pass in the path where the MOF file is stored. Use the Verbose parameter here to have more options in case of errors. Again, it can take hours to complete the process:

Start-DSCConfiguration C:\DemoM365DSC\M365TenantConfig -Wait -Verbose -Force

You might see an error message stating that the request size was exceeded in WinRM. In this case, increase the size with the command:

winrm set winrm/config @{MaxEnvelopeSizekb="8192"}

DSC also lets you check a given configuration against a default every 15 minutes. If the default is not met, DSC can restore the desired state from the MOF file. This process is adjustable, and instructions can be found online [3].

An option to clone configurations is very useful, especially if you manage several tenants that have the same configurations. You can create all the settings on a master tenant and then export the configuration to other tenants.

Generating Evaluations

The ability to compare different configurations with each other is also interesting and would encompass exports of the same tenants at different times, as well as exports from different tenants. M365DSC lets you generate evaluations in Excel and HTML formats. An Excel file only documents one tenant, whereas HTML reports let you make comparisons. To generate a simple report, use:


You can also pass in the -Type parameter as Excel or HTML and use ConfigurationPath to define the location of the configuration file – not the MOF file, but the M365TenantConfig.ps1 file (if you keep the default name).

The -OutputPath parameter specifies the location of the report. You must specify the location and file name. Without a file name, if you choose the HTML option, you will see the output in PowerShell, but the file will not be created on the filesystem. The Excel option opens the file in Excel, but -OutputPath has no meaning, because a file can only be saved in Excel. For a comparison use the command


with -Source and -Destination parameters, which also point to the respective configuration files. In this way you create an HTML file; again, you need to specify the location with -OutputPath. If you omit the parameter, the HTML output is displayed on the PowerShell console.


DSC for Microsoft 365 can be used to archive configurations and restore them when needed. You can also compare different tenants – and don't forget the possibility to keep the settings of multiple tenants in sync easily and reliably. The administrative gains more than make up for the comparatively costly setup overhead.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs

Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>


		<div class=