Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Is it possible to create a dynamic group where the current user of a workstation is a member of the local administrators group?

I only want the dynamic group to show computers where the current user is also a member of the local administrators group. Something like below. Is it possible to use a variable to get the current user?

1

Comments

2 comments
Date Votes
  • Unfortunately, filters cannot compare fields to each other, only static data, Variables, and other collections.

    However, a SQL Report should be able to do that.

    1
  • I've never messed around with SQL reports until your comment, but this was easy, thanks.

    For anyone who might hit this from Google, here is the query I created:

    SELECT [Computers].[Name],
        [Computers].[CurrentUser],
        [LocalGroupMembers].[GroupName],
        [LocalGroupMembers].[UserDomain],
        [LocalGroupMembers].[UserName]
    FROM [Computers]
    INNER JOIN [LocalGroupMembers] ON [Computers].[ComputerId] = [LocalGroupMembers].[ComputerId]
    WHERE [LocalGroupMembers].[GroupName] = 'Administrators'
        AND [LocalGroupMembers].[UserDomain] || '\' || [LocalGroupMembers].[UserName] = [Computers].[CurrentUser]

     

    3