Link to home
Start Free TrialLog in
Avatar of Roccat
RoccatFlag for United States of America

asked on

Adding all users from AD group to list view

This is my first time looking into using list view in powershell studio.  I am looking to get all users in an active directory group and show them in a list view. After I get the working eventually I would like to be able to select a user in the list view and remove that user from the AD group with a button.

So for now I am just looking for help on how to query AD for a list of users and show them in the list.
Here is the line of code I can use to show the list in the powershell ise. How can I populate a listview object with this list of users?
Get-ADGroupMember -identity "students" -Recursive | Get-ADUser -Property DisplayName | Select Name
ASKER CERTIFIED SOLUTION
Avatar of Roccat
Roccat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Roccat

ASKER

I ended up changing the listview to listbox

$here = Get-ADGroupMember -identity "yard-students" -recursive | Get-ADUser -Property DisplayName | Select -expandproperty Name
load-listbox -Listbox $listbox1 -Items $here