List of all machines used by users in a certain AD group

select distinct
R.Name,
SCU.TopConsoleUser
from
SMS_R_System R
inner join SMS_G_System_SYSTEM_CONSOLE_USAGE SCU on SCU.ResourceID = R.ResourceId
where
SCU.TopConsoleUser in ( select
     U.UniqueUserName 
    from 
     SMS_R_User U 
    where
     U.UserGroupName = “GARTEK\\Test1”)

Leave a Reply

Your email address will not be published. Required fields are marked *