Have you ever wanted some information from the SCCM SQL DB, which you can access in the console but can’t find the data easily in the DB? Helpfully, all the data you access in the console is retrieved from the site server – which keeps a record of the queries.
Open the SCCM Console and access the data in the console, this can be loading a list of devices or even a status message query.
Look at the log file “SMSProv.log” located in %Program Files%\Microsoft Configuration Manager\Logs. You should be able to find the query that the site server ran to get the data.
\\SCCMSITESERVER\drive$\%Program Files%\Microsoft Configuration Manager\Logs\SMSProv.log