Hallo PowerShell Freunde,
Ich suche eine Möglichkeit (Source), mit dem ich in meiner Form alle Active Directory Gruppen in einem Listview ausgeben kann. Im Listview sollen der Name, die GroupCategory und GroupScope ausgegeben werden. Kann mir dabei bitte helfen?
Hello PowerShell friends,
I am looking for a way (source) to output all Active Directory groups in a listview in my form. In the listview I want to output the name, GroupCategory and GroupScope. Can help me with this please?
$Groups = Get-ADGroup -Filter{GroupCategory -eq "security"}
ForEach ($Group in $Groups)
{
$itm = New-Object System.Windows.Forms.ListViewItem
$itm.ImageIndex = 0
$itm.Name = $Group.Name
$itm.Text = $Group.Name
$itm.Subitems.Add($Group.GroupCategory)
$itm.Subitems.Add($Group.GroupScope)
$listView3.Items.Add($itm)
}
bekomme keine Ausgabe in meinem Listview, was mache ich falsch?
do not get any output in my listview, what am I doing wrong?
Alle Active Directory Gruppen in einem Listview ausgeben
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
-
- Posts: 2
- Last visit: Tue Nov 15, 2022 9:33 am
Alle Active Directory Gruppen in einem Listview ausgeben
Last edited by Werner1088 on Sun Nov 13, 2022 10:18 pm, edited 1 time in total.
Re: Alle Active Directory Gruppen in einem Listview ausgeben
Hi Werner,
Here is a TreeView that will show you how to work with AD and WinForms controls.
Here is a TreeView that will show you how to work with AD and WinForms controls.
- Attachments
-
- Demo-ADSITreeView.psf
- (23.67 KiB) Downloaded 129 times
Re: Alle Active Directory Gruppen in einem Listview ausgeben
Here is another demo that shows other methods of working with the Net Framework ADSI classes.
- Attachments
-
- Demo-ADUpdateForm.psf
- (23.63 KiB) Downloaded 127 times
-
- Posts: 2
- Last visit: Tue Nov 15, 2022 9:33 am
Re: Alle Active Directory Gruppen in einem Listview ausgeben
Hello, thank you for your answer, but unfortunately this is not what I am looking for.
Re: Alle Active Directory Gruppen in einem Listview ausgeben
Then start here: https://info.sapien.com/index.php/guis/ ... ew-control
This can be helpful too: https://www.sapien.com/books_training/W ... werShell-4
This can be helpful too: https://www.sapien.com/books_training/W ... werShell-4
Re: Alle Active Directory Gruppen in einem Listview ausgeben
Here is a working demo showing how to populate and use a ListView.
- Attachments
-
- Demo-ListView.psf
- (37.83 KiB) Downloaded 137 times