ConfigMgr Health-Check Reporting PowerShell functions
CMHealthCheck is intended to make the former standalone PowerShell scripts "get-cm-inventory.ps1" and "export-cm-healthcheck.ps1" easier to invoke as a module from PowerShell Gallery. Both scripts have been refactored into a simple PowerShell module, with two public functions: Get-CMHealthCheck and Export-CMHealthCheck. The required support XML data files are now invoked via URI from GitHub gist locations (on this account), but they can be downloaded for offline use as well.
Part 1 - Data Collection
- Log onto SCCM site server with full admin credentials (SCCM, Windows and SQL Server instance)
- Open PowerShell console using Run as Administrator
- Enter: Install-Module CMHealthCheck
- Run: Get-CMHealthCheck (parameters...)
- Collect output files from $env:USERPROFILE\Documents\YYYY-MM-DD\hostname
- Copy to machine which has Office 2013 or 2016 installed (part 2)
Part 2 - Reporting
- Log onto a Windows computer which has Office 2013 or 2016 installed
- Open PowerShell console using Run as Administrator
- Enter: Install-Module CMHealthCheck
- Run: Export-CMHeathCheck (parameters...)
- Wait for Document to finish building, Save document
- Review report, add comments, dance around, drink, run outside buck nekkid and laugh hysterically
Get-CMHealthCheck -SmsProvider "cm01.contoso.com" ...
-
SmsProvider "name"
FQDN of ConfigMgr site server. Example: "cm01.contoso.com"
-
OutputFolder "path"
Optional Path for output files. Default is $env:USERPROFILE\Documents. The script will create two (2) folders beneath this location: _Logs, and another using YYYY-MM-DD, with a sub-folder named after the SmsProvider value.
-
NumberOfDays integer
Optional Integer value, number of days to go back for status logs to inspect. Default is 7
-
HealthcheckFilename "path-or-uri"
Optional Path or URI to cmhealthcheck.xml, which provides rules for gathering data. Default is Git Gist URL https://raw.githubusercontent.com/Skatterbrainz/CM_HealthCheck/master/cmhealthcheck.xml
-
Overwrite
Optional Switch parameter to force replacing output if on same date. If the function has been executed on a given ConfigMgr site server on the same date, there will already be a "YYYY-MM-DD\hostname" output file with data files. Without the -Overwrite switch, the default behavior is to display a warning and abort.
-
NoHotFix
Optional Switch parameter to skip auditing of installed hotfixes. This may save time when re-running a data collection in test environments.
-
Verbose
(ummm, yeah)
Example 1
Get-CMHealthCheck -SmsProvider "cm01.contoso.com"
Example 2
Get-CMHealthCheck -SmsProvider "cm01.contoso.com" -Verbose
Example 3
Get-CMHealthCheck -SmsProvider "cm01.contoso.com" -OutputFolder "C:\Temp" -NumberOfDays 30
Export-CMHealthCheck -ReportFolder "path to output files" ...
-
ReportFolder "path"
Mandatory Path to where the collected data files reside from using Get-CMHealthCheck. This can be a local path or a remote UNC path.
-
Detailed
Optional Switch parameter to force more verbose reporting output / strongly recommended!
-
CoverPage "name"
Optional Name of Microsoft Word cover page. List of valid names varies based on the version of Office Word installed.
Default is "Slice (Light)"
Word 2016 names: Austin, Banded, Facet, Filigree, Grid, Integral, Ion (Dark), Ion (Light), Motion, Retrospect, Semaphore, Sideline, Slice (Dark), Slice (Light), Viewmaster, Whisp
-
CustomerName "name"
Optional Name of customer or organization who owns the ConfigMgr site server being audited. Default is "Customer Name"
-
AuthorName "name"
Optional Name of author generating the report (you?). Default is "Your Name"
-
CopyrightName "name"
Optional Name to place in footer of every page along with (C)YYYY ..... Default is "Your Company Name"
-
HealthcheckFilename "path-or-uri"
Optional Path or URI to cmhealthcheck.xml, which provides rules for gathering data. Default is Git Gist URL https://raw.githubusercontent.com/Skatterbrainz/CM_HealthCheck/master/cmhealthcheck.xml
-
MessagesFilename "path-or-uri"
Optional Path or URI to messages.xml, which provides status value message lookups. Default is Git Gist URL https://raw.githubusercontent.com/Skatterbrainz/CM_HealthCheck/master/Messages.xml
-
HealthcheckDebug
Optional Switch parameter to enable additional verbose output
-
Overwrite
ignore this, I had no sleep and a cat that wouldn't leave me alone
Example 1
Export-CMHealthCheck -ReportFolder "C:\Temp\2017-10-23\cm01.contoso.com" -Detailed -CustomerName "Contoso" -AuthorName "Mike Hunt" -CopyrightName "Fubar LLC"
Example 2
Export-CMHealthCheck -ReportFolder "C:\Temp\2017-10-23\cm01.contoso.com" -Detailed -CustomerName "Contoso" -AuthorName "Mike Hunt" -CopyrightName "Fubar LLC" -HealthcheckDebug -Overwrite
Example 3
Export-CMHealthCheck -ReportFolder "C:\Temp\2017-10-23\cm01.contoso.com" -Detailed -CustomerName "Contoso" -AuthorName "Mike Hunt" -CopyrightName "Oh My God, Please No!!?" -CoverPage "Ion (Dark)" -HealthcheckFilename "C:\Temp\cmhealthcheck.xml" -MessagesFile "C:\Temp\messages.xml" -HealthcheckDebug -Overwrite
-
Tested with the following environments:
- ConfigMgr 1610, 1702, 1706, 1709
- Windows Server 2012 R2, 2016
- Windows 10 1703, 1709
- Office 2013, 2016
- PowerShell 5.0, 5.1.14393.1770, 5.1.16299.19
-
If you like it, please share with others. If you hate it, tell me why so I can improve on it?
-
Please submit bugs, comments, requests via the "Issues" link above.
- To remove CMHealthCheck module and related files, use the Remove-Module cmdlet.