Tuesday, 12 December 2023

SCCM - SQL Query to get Scan Failed Device Details

 

select distinct sys.name0 [Computer Name],os.caption0 [OS],convert(nvarchar(26),ws.lasthwscan,100) as [LastHWScan],convert(nvarchar(26),sys.Last_Logon_Timestamp0,100) [Last Loggedon time Stamp],

sys.user_name0 [Last User Name] ,uss.lasterrorcode,uss.lastscanpackagelocation from v_r_system sys

inner join v_gs_operating_system os on os.resourceid=sys.resourceid

inner join v_GS_WORKSTATION_STATUS ws on ws.resourceid=sys.resourceid

inner join v_updatescanstatus uss on uss.ResourceId=sys.ResourceID

where uss.lasterrorcode!='0'

order by uss.lasterrorcode

No comments:

Post a Comment

PSAppDeployToolkit in Intune to Check Interactive Session and Install Application with Notifications

  How to Use PSAppDeployToolkit  in Intune to Check Interactive Session and Install Google Chrome with Notifications Managing software insta...