简体   繁体   中英

Powershell GUIs - Is there an Active Directory dialog box for selecting an OU? Like the FileOpenDialog?

Is there a class (possibly exposed through .NET) that allows you to kick off an active directory gui tree list? I have an app where I'm iterating the top level OU structure of a domain and presenting the distinguished name in a dropdown in my PowerShell gui but a more elegant solution (IMO) would be to click a button and allow the user to select the level of the OU to run the program against. Does anyone know what library/class/etc. I could use to accomplish this task in PowerShell? thanks in advance!

So it isn't perfect but I modified a treeview to dynamically enumerate the local domain structure displaying distinguishedNames. Now, this isn't perfect, but it works for what I need it for:

http://thepip3r.blogspot.com/2011/06/powershell-guis-active-directory.html

kudos to Micah for this awesome solution from https://itmicah.wordpress.com/2016/03/29/active-directory-ou-picker-revisited/

(I have been previously criticized on stackoverflow for posting a link only but for this no alternative as this code exceeds the 30,000 characters allowed)

https://raw.githubusercontent.com/ITMicaH/Powershell-functions/master/Active-Directory/OUs/ChooseADOrganizationalUnit.ps1

It exists as COM object usable in C++ as explain in Microsoft Documentation .

Multiple developers port it to .NET. I use the one from a french code sharing named Codes-Sources and adapt it to my needs.


Edited

You can get there to use Microsoft Directory Object Picker in PowerShell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM