Configuration Manager Documentation Script

Profile picture for user PaulW

Originally posted on the Cyber Advisors blog on May 7, 2018. Updated and expanded below.


New Version 4 includes a UI!!  See below!

Administration of Configuration Manager is more than a full-time job by itself.  Maintaining some sort of documentation for the environment that can be given to management or stored internally can be an all together second job.  So, why continue a manual task of creating documentation when you could automate it and have an extensive and detailed document created in minutes instead of hours.

In 2013, David O’Brien, https://david-obrien.net, created a massive documentation script, written in PowerShell, that would collect a ton of information from a Configuration Manager environment.  He has since moved on from Configuration Manager and posted the last version of his script out on GitHub for everyone to use and possibly expand upon.

For quite some time now, I have wanted to dissect and bring it up to date and make it better in some ways.  So, I forked his github repository and over the last month or so, I’ve been nibbling at it here and there in my free time and finally have it at a pretty good place.  So, here’s what I did.

The first thing that always bugged me about the script was the requirement for Microsoft Word to write the documentation.  Often, it would have been easiest to just run the script from the CM server where Word should never be installed.  So, I dumped the first 2000+ lines (needed for MS Word) and built some functions to allow me to write the entire document in HTML.  The obvious advantage here was no requirement for Word.  All you need is PowerShell.  And, the HTML is written in a way, that you can always import it into Word and make any additions or format changes you want after.

So, my updated script contains everything collected from the original and much more.  Below is a summary of what’s New (my personal favorites are bolded):

  • Removed dependence on Microsoft Word.
  • Formatted HTML output.
  • Updated to work with Current Branch (1710+).
  • Collects everything for Software Updates (ADRS, Config, Packages, Groups)!!
  • Full details of your Automatic Deployment Rules.
  • Collects important Info for SQL database.
  • Collects Site features and servicing history.
  • Collect Default Boundary Group settings.
  • Extended to include configuration of all the new Client Settings.
  • Now Includes all the settings of the Default Client Settings. (v 3.60)
  • Collects additional Collection information.
  • Summarizes Collections with maintenance windows.
  • Summary of all the different Compliance settings (Conditional Access, Company resources, etc).
  • Updated Endpoint Protection Profile info.
  • MUCH more detail on Applications.
  • Added OSD Related Items (Installers, Images, Upgrade Packages)
  • Lists Task Sequence steps.
    • Additional Step Details: Conditions, Nested Task Sequences, Continue on Error
  • Site Maintenance tasks with more details.
  • Site Roles listed with full details.
  • Collect only a Site Summary or detailed information options.
  • CM Scripts

Added Since version 4.0

  • Co-Management Settings.
  • Version 4 UI!!
    Version 4 UI Image

I’m maintaining the script out on GitHub. Download the latest version here.

As I have more free time, I’ll be adding more.  And as CM continues to evolve, more will come from there as well.

If you have something you want to add, I welcome contributions!  Fork it, tweak it, make it better!  There have already been some great contributions for the Site Maintenance tasks and site roles!  So,if you have ideas of items to add, run into issues running the script, post here or to the Issue tracker on GitHub.

 

Run with UI!

To run it with the UI, simply download and run DocumentCMCB.ps1 with no parameters and the UI will launch.  Most of the selectable options will have help text when you hover over them for more details.

.\DocumentCMCB.ps1

 

Run without UI

If you want to skip the UI, and run it like you always you can still run it like this:

.\DocumentCMCB.ps1 -ListAllInformation -CompanyName "Acme Inc."

If you specify "ListAllInformation" be prepared for a very large document and the script to take some time to run.

 

Additional details on the script, and how to use it, are available in the ReadMe on Github.

Let me know what you think of the updated script!

Related Technology

Comments

 

Downloaded the latest version and it works fantastically on current branch! We are about to decommission our legacy 2012 environment and I want to document as much as I can before shutting it down. I ran the script against it and many of the commands it couldn't process as they were too new. I don't know the history of this script but is there possibly an older version that can be run against 2012 that would be more compatible? Thanks!

I LOVE this script!!! I have referred to it to re-create corrupted ADRs and such.

 

At line 79, I added:

[parameter(Mandatory=$False)]

[string]$SMTPServer = "SMTP",

[parameter(Mandatory=$False)]

[string]$MailTo = "Richard Crews <ToEmail>",

[parameter(Mandatory=$False)]

[string]$MailFrom = "SCCM Monitor <FromEmail>",

[parameter(Mandatory=$False)]

[string]$SubjectLine = "SCCM Documentor",

[parameter(Mandatory=$False)]

[string]$CopyPath = "DocumentationFolderPath",

At the end I added:

Write-host "Beginning copy of $FilePath to $CopyPath"

Copy-Item $FilePath -Destination "$CopyPath" -Force

Write-host "Sending email."

Send-MailMessage -From $MailFrom -To $MailTo -Subject $SubjectLine -Body "Completed execution at $($ScriptEndTime.ToShortTimeString()) with a total execution time of $ExecTimeString

A copy of the report has been saved to $CopyPath" -Attachments $FilePath -Priority High -SmtpServer $SmtpServer

Glad it helps you out.  I like it for stuff like you refer to as well.

I like this idea of sending an email.  I see that you added it out on GitHub as well  I'll take a look at incorporating these.  I'll look at a parameter set for emailing, or feel free to fork and merge request it back in!

Paul,

Thank you for this, it is a great time saver.

 

Hello. This looks like exactly what I need but for some reason, I am having no luck running the script. Does this need to run on the site server or can it run on a client workstation with the console installed?

In reply to by Aron (not verified)

Yes, it should be able to run on either.  I suggest posting any errors you are getting over on Github here https://github.com/paulwetter/DocumentConfigMgrCB/issues, and we can help troubleshoot better from there.

Hi,

great tool.

Can you use uppercase for e.g. computer-names as we have a mix and it looks bad.

Can you also alphabetically sort objects like Apps, Packages and maybe add the source folder paths?

regards, Roland

 

 

 

Hi Paul,

I get this error when running the script with defaults (unchecked):

Write-HTMLTable : Cannot bind argument to parameter 'InputObject' because it
is null.
At C:\Temp\DocumentConfigMgrCB-master\DocumentCMCB.ps1:8283 char:38
+ ... InputObject ($ADRDeployments|Select-Object @{Name='Collection';expres ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Write-HTMLTable], ParameterBin
   dingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,W
   rite-HTMLTable

Have ran this in 2 environments and this is fantastic, however on both attempts an error appears:

Invoke-CimMethod : The WS-Management service cannot process the request because it contains an invalid character. WS-Management cannot convert the string to a 
number. String: true. Ensure that the string represents the correct datatype.
At D:\Temp\Hierarchy\DocumentConfigMgrCB-master\DocumentCMCB.ps1:2922 char:34
+ ... onMapping = Invoke-CimMethod -Namespace "ROOT\SMS\site_$SiteCode" -Ci ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ProtocolError: (ROOT\SMS\site_P01:SMS_CoMgmtConfigs:String) [Invoke-CimMethod], CimException
    + FullyQualifiedErrorId : HRESULT 0x80338041,Microsoft.Management.Infrastructure.CimCmdlets.InvokeCimMethodCommand
    + PSComputerName        : localhost

What are the minimum permissions necessary to successfully run this script against an environment (CM/SQL)?

In reply to by Michael (not verified)

Unfortunately, I haven't ever fully explored the minimum permission requirements.  You'll need read to basically everything though as it is reading pretty much everything in CM.  This is difficult to probably get without full admin, though haven't tried it.  If doing remotely from site server, you'll need to be able to execute WMI remotely as well.  From the sql front, you'll need more than just access to the specific database as it is reading from some of the system databases as well to get details on the SQL instance.

Is there any possibility to get the result as a *.xml file

i would need the output as a xml file. is there a possibility to change the setting so a xml file should be the result instead. 

In reply to by HerbertP (not verified)

Unfortunately no. I was a bit short sighted when I rewrote it and cornered myself into a html output.  If I were to build xml. There would be a question on how to structure it. Would it be done for documentation or backup?  Hindsight, I’d almost want to document as markdown. Things you learn 5 years later. :)

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.