SCCM Gather Script Documentation

This guide will walk through the requirements and steps to successfully generate documentation using Documentation as a Service.

Pre-Requesites

  • Powershell version 5.1
  • Run on a Config Manager Primary Site server.
  • Config Manager default Powershell Module
    • Installed by default with Config Manager.
  • Config Manager Administrator Credentials

Downloading the latest Gather Script

  • Open a Browser and navigate to https://DocumentationAsCode.com
  • Log in with your Softchoice account
  • On the services dashboard, under Documentation as Code, select AD
  • Click the link to download the latest version of the gather script - it will be a zip file
  • Open your downloads folder and extract Get-SCCMResources.zip to a new folder on your C: drive
    • Make sure to save the gather script somewhere you can easily find it
    • If you are downloading the script on a Softchoice or BYOD machine, either download from a client-provided machine or copy from your machine to a client-identified one

Running the gather script

  • Login to your Configuration Manager Primary Site Server. Ensure you've logged in with an account with full administrative access to the Configuration Manager Environment.
  • Browse to where you saved the gather script
  • The script will use your current credentials; use credentials for an account that has access to the environment you will document
  • Open a Administrative Powershell instance and change the directory to the one you saved the extracted script to.
  • Run the Get-SCCMResources.ps1 script with the following arguments. Note that all arguments should be encapsulated with double quotes ":

    • CmdletPath (Required)

      • The path to the ConfigurationManager.psd1 file on your primary site server. This is typically found in the Microsoft Configuration Manager installation folder under AdminConsole\Bin
        • Example: E:\Program Files\Microsoft Configuration Manager\AdminConsole\bin
    • smsSiteCode (Required)

      • The site code used in the Configuration Manager environment followed by a colon :
        • Example: SMS:
    • outputDirectory (Optional, Defaults to c:\scripts)

      • The folder that the output file will be created in. If this folder doesn't exist it will be created automatically when the script it run.
        • Example: c:\scripts
    • outputFileName (Optional, Defaults to sccm.json)

      • The name of the JSON file that will be created by this script.
        • Exmaple: sccm.json
    • Examples:

      • .\Get-SCCMResources.ps1 -CmdletPath "E:\Program Files\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1" -smsSiteCode "MJT:"
      • .\Get-SCCMResources.ps1 -CmdletPath "E:\Program Files\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1" -smsSiteCode "MJT:" -outputDirectory "c:\outFolder" -outputFileName "ConfigMgrOutput.json"
  • The JSON file will be created in the specified output folder when the script is complete.

Generating Documentation

  • Return to https://DocumentationAsCode.com
  • Login with your Softchoice account
  • On the services dashboard, under Documentation as Code, select "SCCM"
  • Under Generate Reports:
    • Enter the customer's name
    • Enter your name
    • Click the "Browse" button and navigate to the JSON file that the script created or where you saved it if you copied it to another machine.
  • Click Generate Document
  • You'll see a notification that the file has been uploaded and will be delivered shortly
  • Check your email for the documentation, coming from dac@softchoice.com
    • Note: Check your Other or Junk folders if you do not recieve your document within 5 minutes
  • Click the Download Document button in the email to download your documentation
    • Note: By default, the file will automatically save and download to the root of your largest fixed disk volume