I need to display the standard "Select Users and Groups" dialog from a .NET/WPF application. I also need to be able to display it under a 64bit OS. I found this CodeProject article, which is quite ancient, dating back to the .NET 1.1 days. It is written in Managed C++ and exposed as a COM object, which will not work for my needs.
Has anyone implemented, or know of an implementation, of a pure .NET/C# wrapper for displaying and interacting with the standard system "Select Users and Groups" dialog that will work with a WPF application?
Well, I found a solution. Turns out I was searching for the wrong thing. Instead of "Select Users or Groups", the correct thing to search for is "Active Directory Object Picker". The ADOP is the common dialog that is used to pick any object from Active Directory, including users, groups, computers, etc. It just so happens that this dialog is titled "Select Users or Groups" most of the time.
For the benefit of anyone else who has run into this problem, I'm posting a link to a CodePlex project, Active Directory Common Dialogs .NET that provides a very easy to use .NET wrapper for this dialog. Makes it pretty much as easy to use as any other common .NET dialog:
http://adui.codeplex.com/
For those of you running on a 64bit operating system, or a more modern operating system (Win2k8+), you may encounter a crash after selecting users or groups and choosing ok. The solution to the problem is here:
http://www.codeplex.com/ADUI/Thread/View.aspx?ThreadId=38047
Hope this helps anyone else who was/is looking for the same thing.
We have created a NuGet available at https://github.com/Tulpep/Active-Directory-Object-Picker.
It is based on this project https://adui.codeplex.com/, the project mentionet by others, but with the memory leak fixed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With