Help for a gui script


I need help,

I want to make a script to display all the groups of a windows user in a gui using the cmd let “Get-ADGroupMember” then I can select several of them to do a click button event that copy the selected groups into another users that needs the groups.

what should I use to do that ? combobox ? listview ?..

Then I suggest a multiselect listbox.

You can use Out-GridView as a gui to display and select multiple users.

Get-ADGroupMember -Identity group1 |Out-GridView -Passthru -OutputMode Multiple

There are ways to do what you are after without write any GUI/Form code. See these.

Creating a Simplistic GUI Interface with Out-GridView

Creating a GUI Using Out-GridView in PowerShell

Fun with PowerShell’s Out-GridView

Poor Man’s GUI

Show-Command - PowerShell for GUI admins?

Tag Archives: Out-Gridview (A PowerShell Core Out-Gridview Solution)

So, stuff like…

(Get-ADGroupMember -Identity $((Get-ADGroup -Filter '*').Name | 
Sort-Object | 
Out-GridView -Title 'Select a group' -PassThru)).Name | 
Out-GridView -Title 'Select member name(s)' -OutputMode Multiple

The write whatever code you want to process that return.