Extract ConfigMgr Site data
Get-CMHealthCheck [[-SmsProvider] <String>] [[-OutputFolder] <String>] [[-NumberOfDays] <Int32>]
[[-Healthcheckfilename] <String>] [-OverWrite] [-NoHotfix] [<CommonParameters>]
Exracts SCCM hierarchy and site server data and stores the information in multiple XML data files which are then processed using the Export-CM-Healthcheck.ps1 script to render a final MS Word report.
.\Get-CMHealthCheck -SmsProvider cm01.contoso.com -NumberofDays:30
.\Get-CMHealthCheck -SmsProvider cm01.contoso.com -Overwrite -Verbose
.\Get-CMHealthCheck -SmsProvider cm01.contoso.com -HealthcheckDebug -Verbose
.\Get-CMHealthCheck -SmsProvider cm01.contoso.com -NoHotfix
.\Get-CMHealthCheck -SmsProvider cm01.contoso.com -OutputFolder "c:\temp"
.\Get-CMHealthCheck -SmsProvider cm01.contoso.com -OutputFolder "c:\temp" -HealthcheckFilename ".\healthcheck.xml"
FQDN of SCCM site server
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: "$(($env:COMPUTERNAME, $env:USERDNSDOMAIN) -join '.')"
Accept pipeline input: False
Accept wildcard characters: False
Path to output data folder, default is “My Documents”
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: "$([System.Environment]::GetFolderPath('Personal'))"
Accept pipeline input: False
Accept wildcard characters: False
Number of days to go back for alerts in logs (default = 7)
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: 7
Accept pipeline input: False
Accept wildcard characters: False
Name of configuration file (default is .\assets\cmhealthcheck.xml)
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Overwrite existing output folder if found. Folder is named by datestamp, so this only applies when running repeatedly on the same date
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Suppress hotfix inventory. Can save significant runtime
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Support: Database name must be CM_<SITECODE> (you need to adapt the queries if not this format)
https://github.com/Skatterbrainz/CMHealthCheck/blob/master/Docs/Get-CMHealthCheck.md