User Selection using ADSI

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
Posts: 6
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Mon Feb 03, 2020 12:22 am

User Selection using ADSI

Post by flho_fvr »

Hi Guys

I'm looking for a way have a "simple" windows-like GUI to select OU's and Users in Active Directory.

I was looking at the script, adtree.psf (download/file.php?id=2552) by Daniel Potter as he presented in the following post - viewtopic.php?t=10784. And with a simple rewrite, I was able to solve the issue by selecting the OU's pretty easily (see attached, could use some comments if the way I did the selection is the correct/best method)

But I still need to extend the script, so I can choose to select users instead of OU's - and I'm having success with that, is there anybody who can give me a hint?

Best regards
(28.83 KiB) Downloaded 21 times

Posts: 14444
Joined: Tue May 22, 2007 9:57 am

Re: User Selection using ADSI

Post by jvierra »

Here is a script that demonstrates the easy way to do this:
(21.98 KiB) Downloaded 32 times