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

Mohamed Alì 1 Reputation point

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


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,168 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Mohamed Alì 1 Reputation point

    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

    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,276 Reputation points
    0 comments No comments

  4. Newbie Jones 1,276 Reputation points

    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