We have used Nik Charlebois’ solutions such as ReverseDSC to extract configurations from existing services such as Microsoft SQL Servers and IIS Web Farms. His latest release of the Office365DSC Module.
The Source Code can be found on GitHub at https://github.com/Microsoft/Office365DSC/
The module is available in the PowerShell Gallery, so to install it, just run Install-Module. *** This requires PowerShell version 5 or higher ***
Install-Module -Name Office365DSC -Force
The Office365DSC PowerShell module is dependent upon the ReverseDSC Module so the ReverseDSC Module must be present on the system. If during the installation of the Office365DSC module, it’s not automatically installed, you can also install it manually.
Install-Module -Name ReverseDSC -Force
For additional information / documentation on how to use the Office365DSC Module, check out Nik’s website at http://nikcharlebois.com/getting-started-with-office365dsc/ and for information on how to extract existing information you can find more help at http://nikcharlebois.com/extract-office-365-configuration-from-existing-tenant/