SMS / SCCM Cleint health find Script

here is the Batch file script for SCCM / SMS Clients health along with Last hardware scan report sent time and lastheartbeat time stamp it will show you in the command window this will help you to know the status of Client agent.
 
====================================================================================
@echo off
@echo Client Version  Last Hardware Inventory  Hours Since Last HINV
osql.exe -S SCCMDBSERVERNAME -d SMS_Sitecode -h-1  -E   -Q"set nocount on select Distinct cast(Client_Version0 as char(20)),cast(max(TimeStamp) as char(30)) as hinvDate,datediff(hh,max(TimeStamp),getdate()) as hoursLame from v_r_system,v_GS_WORKSTATION_STATUS where v_r_system.ResourceID = v_GS_WORKSTATION_STATUS.ResourceID and Name0 like '%1' group by Client_Version0"
==================================================================================================
 
 
Simple save above script into .bat file and give the computer name after the batch file and run
 
like
client.bat systemname
 
Yes………….Life is a batch, and then you FLY ——————-
 

Leave a Comment