How to have a list of users names part of a group when the group contains their computers

Mohamed Alì 1 Reputation point
2022-03-31T11:20:15.393+00:00

Hi all,

I'm looking to get a list of users name with Powershell who are part of a group in AD. The group has as members the VDI computers.
I know how to get the list of VDI's computers but I need to have the users name associated with the VDI's.
And lasty how to put this list into a file (excel or text, whichever is easiest).

I'm sure there is a way to get this but couldn't find something online.

Please help

Thanks

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,508 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Mohamed Alì 1 Reputation point
    2022-03-31T13:13:20.227+00:00

    Hi Andreas,

    We use Remote Desktops on Hyper-V servers. Users are created on AD and assigned using the Broker Server.

    Hope these are the info you needed, let me know.


  2. Mohamed Alì 1 Reputation point
    2022-03-31T14:38:15.83+00:00

    I can identify that by going to the Broker server and from Server manager I can see which VDI belongs to which user. What I need is a command that gives me the list of users in a particular group. The group contains the VDI's computer name. I want that list to show me the names of the users and not VDI's.

    0 comments No comments

  3. Newbie Jones 1,336 Reputation points
    2022-04-01T15:30:00.743+00:00
    0 comments No comments

  4. Newbie Jones 1,336 Reputation points
    2022-04-01T15:40:42.11+00:00

    Apart from that, I don't think you can do this apart from querying the guests. AD itself doesn't really record what you log into.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.