Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING sql query to create a report

  • Thread starter Thread starter dj3094
  • Start date Start date
  • Replies Replies 12
  • Views Views 4K

dj3094

Well-Known Member
Messages
241
Reaction score
7
Points
18
Hello experts,

I am trying to create a sql query to get below information
systemname, last seen, domain, OS, missing patches, last reboot time, patch compliance, updated scan error, last scan update, maintenance window. Is that possible?

Regards
 
I have not started yet, checking if that is possible. I will try to put some views together
 
I came up with this but getting error
SQL:
SELECT        dbo.v_R_System.Name0, dbo.v_R_System.Full_Domain_Name0, dbo.v_R_System.Operating_System_Name_and0, dbo.v_UpdateScanStatus.LastScanState, dbo.v_UpdateScanStatus.LastErrorCode,
                         dbo.v_R_System.ResourceID
FROM            dbo.v_R_System INNER JOIN
                         dbo.v_FullCollectionMembership ON dbo.v_R_System.ResourceID = dbo.v_FullCollectionMembership.CollectionID INNER JOIN
                         dbo.v_UpdateScanStatus ON dbo.v_R_System.ResourceID = dbo.v_UpdateScanStatus.ResourceID
WHERE        (dbo.v_FullCollectionMembership.CollectionID = N'******')
 
You problem is the you are linking collection id to resource id., it will need to link to resource id only.
dbo.v_R_System.ResourceID = dbo.v_FullCollectionMembership.ResourceID
 
we have this huge report which give all the info if we run on small collection, but running it on all machines errors out. Report processing has been canceled by the user. (rsProcessingAborted)
 

Attachments

we have this huge report which give all the info if we run on small collection, but running it on all machines errors out. Report processing has been canceled by the user. (rsProcessingAborted)
First off the download doesn't work. Secondly the bigger the report / sql the this is to be expected. you need to review and edit your report/query.
 
Back
Top