Sign in to follow this  
Followers 0
Furek86

_AD_GetAllOUs() - load into a treeview

4 posts in this topic

Hi guys,

I am trying to get the OU structure for my domain. I am using the function _AD_GetAllOUs() but I struggle when I try to create a tree view based on my results. I know that _AD_GetAllOUs() returns a 2-dimensional array and sub-ous are separated wqith a backslash. Any idea how to put those in a loop so each subOU is under it's parent OU in a treeview?

$TopBranch = GUICtrlCreateTreeViewItem("MyDomain.com", $treeViewOUs)
$array = _AD_GetAllOUs()
for $i = 1 to  $array[0][0]
$branch = GUICtrlCreateTreeViewItem($array[$i][0],$TopBranch
next

Share this post


Link to post
Share on other sites



To display your OU structure in a TreeView please have a look at my example scripts section. Script _AD_Example_GetOUTreeView does what you need.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks!! That is exactly what I needed. Weird i couldn't find it when I searched...

Share this post


Link to post
Share on other sites
:)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0