Download presentation
Presentation is loading. Please wait.
Published byJoel Johns Modified over 6 years ago
1
Treasure Trove of Data: Learn Your ConfigMgr Database's Data
Sherry Kissinger @slkissinger Garth Jones @GarthMJ, Chief Architect Enhansoft
2
Sherry Kissinger Garth Jones @slkissinger @GarthMJ
ECM MVP , 2017 MVP, MSCE, Author A Woman never tells 20+ Years Mojitos Streaming Tech, Whiskey
3
What Treasure will you Find?
Treasure Hunting Tools User Treasures Computer Treasures Buried Treasures Hidden Treasures!!!!
4
Treasure Hunting Tools
ConfigMgr Console SQL Server Management Studio WMI Explorer PowerShell ISE
5
User Treasures Who is a Member of domain admins?
What AD groups does Garth belong too?
6
User Treasures
7
User Treasures – AD Group Membership
Select U.Unique_User_Name0 from dbo.v_R_User U join dbo.v_RA_User_UserGroupName UUGN on U.ResourceID = UUGN.ResourceID Where UUGN.User_Group_Name0 = 'gartek\domain admins' order by
8
User Treasures – User Groups
Select UUGN.User_Group_Name0 from dbo.v_R_User U join dbo.v_RA_User_UserGroupName UUGN on U.ResourceID = UUGN.ResourceID Where U.Unique_User_Name0 = 'Gartek\garth' order by
9
Hunting Demo Wbemtest, wmi explorer, sql database, Console, Powershell
10
Computer Treasures Resource Explorer is your Friend!
11
Exploring Resource Explorer
12
Buried Treasures AI Treasures! Enable Software Metering
Software Metering: Bells Cargo, the company Sherry works for, enables SW metering, but for 1 rule only. Explorer.exe. That’s used in a complex logical construct to help figure out who the primary user of a machine is, if the console user data isn’t sufficient to do so.
13
Computer Treasures – SQL 1
Select RV.Netbios_Name0, TAG.ProductName0, TAG.DisplayVersion0, TAG.SoftwareCreator0 from dbo.v_R_System_valid RV join dbo.v_GS_SOFTWARE_TAG TAG on RV.ResourceID = TAG.ResourceID
14
Buried Treasures Select rua.ExplorerFileName0 [Filename], rua.FolderPath0 [Folder], rua.Fileversion, Count(*) [Count] from v_gs_ccm_recently_users_apps rua where rua.ExplorerFileName0 in (‘MicTray64.exe‘,’MicTray.exe‘) Group By rua.ExplorerFileName0, rua.FolderPath0, rua.FileVersion
15
SQL Hunting for AI Treasures
16
Hidden Treasures!!!! User Emails addresses User Manager
Other Custom Treasures Some default sorta-kinda-hidden things: Collection information: Limited to, Include, Excludes, queries inside, how long they took to evaluate the last time.
17
User Treasures – User Email Address
Select U.Full_User_Name0, Case When isnull(U.Mail0, 'n/a') = 'n/a' then 'n/a' when U.Mail0 = '' then 'n/a' else U.Mail0 End as ' ' from dbo.v_R_User U
18
User Treasures
19
User Treasures – User’s Manager
Select M.Full_User_Name0, U.* from dbo.v_R_User U left outer join (Select U.Full_User_Name0, U.Distinguished_Name0 from v_R_User U) as M on U.manager0 = M.Distinguished_Name0
20
Hidden Treasures!!!! – Collection
--SQL query for Collection Evaluation Times Select c.collectionid, c.name, DateDiff(s, c.EvaluationStartTime, c.LastRefreshTime) as [EvalTime (seconds)] from v_collection c --SQL Query for Collection include, exclude, information select distinct c.name as [Collection Name], c.collectionid, cdepend.SourceCollectionID as 'Collection Dependency', cc.Name as 'Collection Dependency Name', Case When cdepend.relationshiptype = 1 then 'Limited To ' + cc.name + ' (' + cdepend.SourceCollectionID + ')' when cdepend.relationshiptype = 2 then 'Include ' + cc.name + ' (' + cdepend.SourceCollectionID + ')' when cdepend.relationshiptype = 3 then 'Exclude ' + cc.name + ' (' + cdepend.SourceCollectionID + ')' end as 'Type of Relationship' from v_Collection c join vSMS_CollectionDependencies cdepend on cdepend.DependentCollectionID=c.CollectionID join v_Collection cc on cc.CollectionID=cdepend.SourceCollectionID where c.CollectionID
21
Hidden Treasures!!!! - MW --SQL query for Collection Service Windows Select sw.ServiceWindowID, case when sw.ServiceWindowType = 1 then ‘Normal’ when sw.ServiceWindowType = 4 then ‘Software Updates Specific’ when sw.ServiceWindowType = 5 then ‘OSD Task Sequence Specific’ end as ‘Service Window Type’, sw.Name, sw.Description, sw.Starttime, sw.Duration [Duration in Minutes], (sw.Duration/60) as [Duration in Hours], case when sw.isenabled=1 then ‘TRUE’ else ‘FALSE’ end as [Enabled] from v_ServiceWindow sw where --SQL Query for ‘what service window is THIS box in’ as nvarchar(15) = ‘ComputerNameHere’ Select ComputerName sw.ServiceWindowID, case when sw.ServiceWindowType = 1 then ‘Normal’ when sw.ServiceWindowType = 4 then ‘Software Updates Specific’ when sw.ServiceWindowType = 5 then ‘OSD Task Sequence Specific’ end as ‘Service Window Type’, sw.Name, sw.Description, sw.Starttime, sw.Duration [Duration in Minutes], (sw.Duration/60) as [Duration in Hours], case when sw.isenabled=1 then ‘TRUE’ else ‘FALSE’ end as [Enabled] from v_ServiceWindow sw where sw.Collectionid in (select collectionid from v_fullcollectionmembership where name
22
Hidden Treasures!!!! – OU + UEFI
--SQL query for OU Select RV.Netbios_Name0, case When (Max(OU.System_OU_Name0) != Null or Max(OU.System_OU_Name0) != '') Then Max(OU.System_OU_Name0) Else max(cn.System_Container_Name0) end as 'OU' From dbo.v_R_System_Valid RV left outer join dbo.v_RA_System_SystemContainerName CN on RV.Resourceid = cn.resourceID left outer join dbo.v_RA_System_SystemOUName OU on RV.Resourceid = OU.resourceID Group by RV.Netbios_Name0 --New with Current Branch UEFI Select rv.netbios_name0 [ComputerName], f.Uefi0 [isUEFI] from v_r_system_valid rv left join v_gs_firmware f on f.resourceid=rv.resourceid
23
SQL Queries for hidden treasures
26
Section Header This is the next section
27
Title Line1 Bullet Level 1 Bullet Level 2 Bullet Level 3
28
Title Code
29
Text Only with Border Level 1 Level 2 Level 3
30
Text Only (Red) Level 1 Level 2 Level 3
31
Title Text 1 Level 1 Level 2 Level 3 Text 2 Level 1 Level 2 Level 3
32
Title Section 1 Section 2 Text Text Level 1 Level 1 Level 2 Level 2
33
Demo Title
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.