So this is the first post in a series about how to be proactive with ConfigMgr. I’ve started with something that is relatively straightforward, disk space. Now, you might say that this is too simple because we already have reports in ConfigMgr that tell us this information. What I am aiming to due is get a report that can be used to contact end-users, rather than just report ConfigMgr data about machines.
Prerequisite AD Information
Before we can get started we need to know some information about our users. Where is the best information about users (hopefully)? Active Directory, so we turn to Active Directory User Discovery. For this example, I’m going to extend AD User Discovery to collect the following additional attributes:
sn in this can is surname. You may also want distinguishedName because that is useful in linking people to their managers and linking computer objects to their owners.
Enable Asset Intelligence
Additionally, before we begin we want to enable Asset Intelligence (AI). Enabling AI gets us the primary user of the computer we are looking at. Some people have concerns about the accuracy of this data, and while I agree it’s not perfect it’s a lot better than last logged on user. So go ahead and turn on the following AI classes, if you don’t have them on:
We are going to use four views in this report, as follows:
The following SQL query can be used to create your own reports. You may need to customize this for your own environment (perhaps changing the 0.15 to a parameter for the report or getting it to target a specific collection instead of all machines in the environment). This join format will be reused thought the remainder of this series to show to link computer, inventory and users together.
SELECT Systems.Netbios_Name0 AS 'Computer Name', Disks.Name0 AS 'Drive Letter', ROUND(Disks.FreeSpace0*1.00/Disks.Size0*1.00,2) AS '% Free', Disks.FreeSpace0 AS 'Free Space (MB)', Disks.Size0 AS 'Disk Size (MB)', MaxUsage.TopConsoleUser0 AS 'Primary User', Users.displayName0 AS 'User''s Name', Users.mail0 AS 'E-mail Address', Users.telephoneNumber0 AS 'Telephone Number', Users.givenName0 AS 'Given Name', Users.sn0 AS 'Surname' FROM v_GS_LOGICAL_DISK AS Disks JOIN v_R_System_Valid Systems ON Disks.ResourceID = Systems.ResourceID JOIN v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP MaxUsage ON Disks.ResourceID = MaxUsage.ResourceID JOIN v_R_User Users ON MaxUsage.TopConsoleUser0 = Users.Windows_NT_Domain0 + '\' + Users.User_Name0 WHERE DriveType0=3 AND FreeSpace0 IS NOT NULL AND ROUND(Disks.FreeSpace0*1.00/Disks.Size0*1.00,2) < 0.15
The outputted list will be easy to Word’s Mail Merge feature to draft messages to end users to let them know that their machines are running out of disk space, that this may cause performance problems and IT can help. Alternatively, use this list to call end-users to schedule a visit (perhaps 15% isn’t good for calling but under 100MB or 50MB my justify a call).
This post was contributed by Saud Al-Mishari, a Premier Field Engineer with Microsoft Premier Field Engineering, UK.