One CM SQL View to Rule them All

Profile picture for user PaulW

A few months ago, I learned of a View in the CM database that is basically every column that you can add in the devices node.  Too many times someone wants a report that just lists exactly what they see in the Devices node.  So, this view gives you that without having to do any of those wonderful SQL JOINs we always have so much fun with.

This week in the MMS Tips and Tricks, I decided to show this view, along with using SSMS to filter views.  So lets take a look at the view.

So, all of these columns:
Console Device Node

are contained in this SQL View:

v_CombinedDeviceResources

 

In this view, there are currently 122 columns.  Most of these correspond to columns in the Devices node in the console.  Many are useful, many are not.  These ones I have found to be the most useful.

SQL View ColumnConsole ColumnAdditional Notes
MachineIDResource IDImportant internal CM internal ID for joining to other tables to get additional data.
NameNameComputer Name (Netbios Name)
SiteCodeSite Code 
DomainDomainComputer Domain (NT Domain)
ClientVersionClient VersionThe version of the install client.
ClientCertTypeClient CertificateType of certificate used for client communications.  (PKI, self-signed)
LastClientCheckTimeClient Check Result Change 
ClientCheckPassClient Check Result 
ADSiteNameActive Directory Site 
UserDomainNameUser's Domain(NT Domain)
ADLastLogonTimeLast Logon TimestampFrom Active Directory Computer Account
ClientActiveStatusClient Activity 
LastPolicyRequestPolicy Request 
LastDDRHeartbeat DDR 
LastHardwareScanHardware Scan 
LastMPServerNameManagement PointLast management point that it connected to for policy, etc.
CP_StatusLast StatusLast Status from CM Client Push
CP_LatestProcessingAttemptLast Request AttemptLast Date that a client push was performed
CP_LastInstallationErrorLast Installation ErrorClient Push installation error, if any
DeviceOSOperating SystemAs reported in Active Directory (Microsoft Windows NT Server 6.3)
DeviceOSBuildOperating System Build(like 6.3.9600.20174)
EP_***Endpoint Protection ***Anything EP_ are endpoint protection related fields
CNIsOnlineDevice Online StatusIf the device is currently connected to a MP via the fast channel
CNLastOnlineTimeLast Online TimeLast time it came online via the fast channel
CNLastOfflineTimeLast Offline TimeLast time it went offline via the fast channel
CNAccessMPDevice Online Management PointThe Management Point that the device is currently online with via the fast channel
CNIsOnInternetDevice Online From InternetIf the computer is currently online via the internet for the fast channel
ClientStatePending Restart

This is a bitwise value that dictates the reasons for a reboot.
0 = No reboot Pending
1 = Configuration Manager
2 = File Rename
4 = Windows Update
8 = Add or Remove Feature

These can be combined as well.

PrimaryUserPrimary User(s)Comma separated list of primary users on a computer listed as domain/Username.  So, not perfect for reporting, but good enough for many instances.
CurrentLogonUserCurrently Logged on UserCurrent logged on user, provided through the fast channel. (DOMAIN\username1)
LastLogonUserRecently Logged on User(username1)
MACAddressMAC Address 
CoManagedCo-managed 
BoundaryGroupsBoundary Group(s)Comma separated list of Boundary Groups computer is part of.
IsVirtualMachineVirtual MachineIf the device is detected by CM as a virtual machine.

 

Filtering Views

And as far as filtering views in SSMS goes, this is easiest to show with a short video.

Filtering Views in SSMS

Related Technology

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.