Similar to Ektron SQL β List All Users
If you simply need a list of all of your CMS users whether they are admin or otherwise this script will help
SELECT [user_name] AS 'Username',
([first_name] + ' ' + [last_name]) AS 'Name'
FROM [user_to_group_tbl] utgt
LEFT OUTER JOIN [usergroups] ug ON ug.usergroup_id = utgt.[usergroup_id]
LEFT OUTER JOIN [users] u ON u.user_id = utgt.user_id
WHERE usergroup_name IN ('Everyone')
ORDER BY username
If you want to show a break down of the groups that each user is in this script will help
SELECT --ug.[usergroup_id], [usergroup_name] AS 'User Group', --utgt.[user_id], [user_name] AS 'Username', ([first_name] + ' ' + [last_name]) AS 'Name' FROM [user_to_group_tbl] utgt LEFT OUTER JOIN [usergroups] ug ON ug.usergroup_id = utgt.[usergroup_id] LEFT OUTER JOIN [users] u ON u.user_id = utgt.user_id WHERE usergroup_name IN ( 'Administrators', 'Approvers', 'Everyone' ) ORDER BY username, usergroup_name
Originally Posted on August 20, 2014
Last Updated on October 26, 2015
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.