PowerShell – Useful SCCM client status check scripts

At the time patching cycles starts, every windows admin must go through a lot of pain in troubleshooting patch installation failures wrt to SCCM status, version, site code, etc.
So, before the patching cycle start, we can just execute a few of the below scripts to find whether SCCM client health is good or not.

SCCM Check for Server online/offline, Servers presents in AD or not, Service status, Site Code and SCCM client installed or not