As a SCCM admin, you might have to check SCCM health on a regular basis, and troubleshoot lots of client issues. Normally I have to UNC into the client machine, goes into C:\Windows\CCM\Logs, and then open my CMTrace to check the log. I am a bit tired of this, thus I use PowerShell Universal to build an interactive website to show the results.
This system will show:
- Overall SCCM component status with detail logs
- All SCCM server storage status
- Interactive online SCCM client log viewer
- Online diskspace check on demand
- Patching result report
- SCCM client cleanup list
To get this interactive SCCM monitor & troubleshoot system running, first you need to install PowerShell Universal on your system.
Then you create a dashboard to show all the pages. Here is my main page code:
# SCCM Monitor & Troubleshoot Website
# Rui Qiu
# 9/3/2021
$UDScriptRoot = "E:\Web"
$Theme = @{
palette = @{
primary = @{
main = '#c3073f'
}
#background = @{
# default = '#4e4e50'
#}
}
typography = @{
fontFamily = 'monospace'
fontSize = 13
}
}
$Pages = @()
$Pages += New-UDPage -Name 'SCCM Status' -Content {
. "$UDScriptRoot\components.ps1"
#} -NavigationLayout permanent
} -NavigationLayout permanent
$Pages += New-UDPage -Name 'SCCM Storage' -Content {
. "$UDScriptRoot\storage.ps1"
} -NavigationLayout permanent
$Pages += New-UDPage -Name 'Server Log' -Content {
. "$UDScriptRoot\systemstatus.ps1"
} -NavigationLayout permanent
$Pages += New-UDPage -Name 'Client Log' -Content {
. "$UDScriptRoot\logviewer.ps1"
} -NavigationLayout permanent
$Pages += New-UDPage -Name 'Scheduled Task Log' -Content {
. "$UDScriptRoot\tasklog.ps1"
} -NavigationLayout permanent
$Pages += New-UDPage -Name 'Scheduled Clients Cleanup' -Content {
. "$UDScriptRoot\cleanup.ps1"
} -NavigationLayout permanent
$Pages += New-UDPage -Name 'Disk Space Checker' -Content {
. "$UDScriptRoot\diskspace.ps1"
} -NavigationLayout permanent
$Pages += New-UDPage -Name 'Patching Machine List' -Content {
. "$UDScriptRoot\patchinglist.ps1"
} -NavigationLayout permanent
$Pages += New-UDPage -Name 'Patching Report' -Content {
. "$UDScriptRoot\patching.ps1"
} -NavigationLayout permanent
New-UDDashboard -Theme $Theme -Title 'SCCM Monitor & Troubleshoot' -Pages $Pages
For each detailed page, please refer to these articles:
Here are the references I use when I build this system:
Use IIS to setup website with windows authentication
https://stealthbits.com/blog/how-to-secure-a-default-iis-site-enable-windows-authentication/
SQL query to get sccm component status
https://smsagent.blog/tag/sccm-component-status-report/
PowerShell HTML Formatting
https://petri.com/adding-style-powershell-html-reports
https://petri.com/creating-portable-html-powershell
https://evotec.xyz/working-with-html-in-powershell-just-got-better/
https://adamtheautomator.com/html-report/
https://tiberriver256.github.io/powershell/gui/html/PowerShell-HTML-GUI-Pt3/
Free Diskspace in Chart/Graph
https://eddiejackson.net/wp/?p=17187
https://smsagent.blog/2018/08/15/create-disk-usage-reports-with-powershell-and-wiztree/
Extract status message
http://eskonr.com/2020/11/using-powershell-script-to-extract-the-status-messages-for-sms-provider-site-and-client-in-configuration-manager/
Run Powershell from Webpage via ASP.NET
http://jeffmurr.com/blog/?p=142
https://www.itdroplets.com/create-a-powershell-web-application/
https://tiberriver256.github.io/powershell/gui/html/PowerShell-HTML-GUI-Pt3/