February 2 2011

SCCM report to count enabled users in every domain

I needed a SCCM report to count all enabled users in every domain. This is different to the builtin ‘Count users by domain’ as that one only lists domain users that have logged onto a system (that one is from v_R_System).

Query =

SELECT Windows_NT_Domain0, count(*)
FROM
v_R_User
WHERE User_Account_Control0 = '512'
GROUP BY Windows_NT_Domain0
Order by Windows_NT_Domain0

While I am here, I may as well list 2 other reports that were useful to count all enabled computers in every domain, one report for workstations and one for servers:

SELECT Resource_Domain_OR_Workgr0, count(*)
FROM
v_R_System
WHERE Operating_System_Name_and0 LIKE '%workstation%' AND Resource_Domain_OR_Workgr0 NOT LIKE ''
GROUP BY Resource_Domain_OR_Workgr0
Order by Resource_Domain_OR_Workgr0

SELECT Resource_Domain_OR_Workgr0, count(*)
FROM
v_R_System
WHERE Operating_System_Name_and0 LIKE '%server%' AND Resource_Domain_OR_Workgr0 NOT LIKE ''
GROUP BY Resource_Domain_OR_Workgr0
Order by Resource_Domain_OR_Workgr0

 
 



----------------------------------------------------------------------------
I use a maximum of one Google Ad per post to help offset some of my blog hosting costs.

----------------------------------------------------------------------------