OU Selector

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.
Locked
User avatar
Jcholder
Posts: 7
Joined: Wed Apr 22, 2015 5:50 pm

OU Selector

Post by Jcholder » Sat Nov 05, 2016 11:28 pm

I am using the following code to create an AD tree structure so the user is able to select an OU within that tree and populate a text box (list of computer names). It works, however in an organization with a large AD structure it times out because it takes too long to load everything. I'm not sure if it is trying to pre-populate every object in the tree or not.

What I ultimately want is to build only the tree first, not query any objects in the OU until the user selects a particular OU, then query only that OU for all the objects (computers) contained within it. But I am unsure how to go about doing that, any help is appreciated.

Code: Select all

$OU = Choose-ADOrganizationalUnit
Try
{
$AdComputers = Get-ADComputer -LDAPFilter "(name=*)" -SearchBase $ou | Select-Object name, enabled, DNSHostName
$AD_computers = New-Object System.Collections.ArrayList
Foreach ($item in $AdComputers)
{
If (($item.enabled) -and ($item.DNSHostName -ne $null))
{
$WSUS_Computers.AppendText("$($item.DNSHostName)`n")

}
}
}
catch
{
Write-Debug ($_ | Out-String)
$WSUS_Computers.Text = "No computers found in OU"
}

Code: Select all

function Choose-ADOrganizationalUnit
{
#========================================================================
# Code Generated By: SAPIEN Technologies, Inc., PowerShell Studio 2012 v3.1.24
# Generated On: 29-10-2013 13:45
# Generated By: Michaja van der Zouwen
# Organization: -
#========================================================================
#----------------------------------------------
#region Application Functions
#----------------------------------------------

function OnApplicationLoad
{
#Note: This function is not called in Projects
#Note: This function runs before the form is created
#Note: To get the script directory in the Packager use: Split-Path $hostinvocation.MyCommand.path
#Note: To get the console output in the Packager (Windows Mode) use: $ConsoleOutput (Type: System.Collections.ArrayList)
#Important: Form controls cannot be accessed in this function
#TODO: Add snapins and custom code to validate the application load

return $true #return true for success or false for failure
}

function OnApplicationExit
{
#Note: This function is not called in Projects
#Note: This function runs after the form is closed
#TODO: Add custom code to clean up and unload snapins when the application exits

$script:ExitCode = 0 #Set the exit code for the Packager
}

#endregion Application Functions

#----------------------------------------------
# Generated Form Function
#----------------------------------------------
function Call-AD_OU_select_pff
{

#----------------------------------------------
#region Import the Assemblies
#----------------------------------------------
[void][reflection.assembly]::Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
[void][reflection.assembly]::Load("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
[void][reflection.assembly]::Load("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
[void][reflection.assembly]::Load("System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
[void][reflection.assembly]::Load("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
[void][reflection.assembly]::Load("System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
[void][reflection.assembly]::Load("System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
[void][reflection.assembly]::Load("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
[void][reflection.assembly]::Load("System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
#endregion Import Assemblies

#----------------------------------------------
#region Generated Form Objects
#----------------------------------------------
[System.Windows.Forms.Application]::EnableVisualStyles()
$formChooseOU = New-Object 'System.Windows.Forms.Form'
$treeview1 = New-Object 'System.Windows.Forms.TreeView'
$buttonOK = New-Object 'System.Windows.Forms.Button'
$ButtonCancel = New-Object 'System.Windows.Forms.Button'
$imagelist1 = New-Object 'System.Windows.Forms.ImageList'
$ErrorProviderOU = New-Object 'System.Windows.Forms.ErrorProvider'
$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
#endregion Generated Form Objects

#----------------------------------------------
# User Generated Script
#----------------------------------------------

function Add-Node
{
param (
$selectedNode,
$dname,
$name,
$ou
)
$newNode = new-object System.Windows.Forms.TreeNode
$newNode.Name = $dname
$newNode.Text = $name
IF ($ou -eq $false)
{
$newnode.ImageIndex = 1
$newNode.SelectedImageIndex = 1
}
$selectedNode.Nodes.Add($newNode) | Out-Null
If ($dname -eq $strDomainDN)
{
$newNode.ImageIndex = 2
$newNode.SelectedImageIndex = 2
}
return $newNode
}

function Get-NextLevel
{
param (
$selectedNode,
$dn,
$name,
$OU
)

$OUs = Get-ADObject -Filter 'ObjectClass -eq "organizationalUnit" -or ObjectClass -eq "container"' -SearchScope OneLevel -SearchBase $dn

If ($OUs -eq $null)
{
$node = Add-Node $selectedNode $dn $name $OU
}
Else
{
$node = Add-Node $selectedNode $dn $name $OU

$OUs | ForEach-Object {
If ($_.ObjectClass -eq "organizationalUnit")
{
$OU = $true
}
else
{
$OU = $false
}
Get-NextLevel $node $_.distinguishedName $_.name $OU
}
}
}

function Build-TreeView
{
if ($treeNodes)
{
$treeview1.Nodes.remove($treeNodes)
$formChooseOU.Refresh()
}

$treeNodes = $treeview1.Nodes[0]

#Generate Module nodes
Get-NextLevel $treeNodes $strDomainDN $strDNSDomain

$treeNodes.Expand()
$treeNodes.FirstNode.Expand()
}

$treeView1.add_AfterSelect({
$script:SelectedOU = $this.SelectedNode
})

$FormEvent_Load = {
Import-Module ActiveDirectory
$objIPProperties = [System.Net.NetworkInformation.IPGlobalProperties]::GetIPGlobalProperties()
$strDNSDomain = $objIPProperties.DomainName.toLower()
$strDomainDN = $strDNSDomain.toString().split('.'); foreach ($strVal in $strDomainDN) { $strTemp += "dc=$strVal," }; $strDomainDN = $strTemp.TrimEnd(",").toLower()
Build-TreeView
}



$buttonOK_Click = {
$script:objSelectedOU = Get-ADObject -Identity $SelectedOU.name

}
$ButtonCancel_Click = {
$script:SelectedOU = $null
$FormOU.close()
}

# --End User Generated Script--
#----------------------------------------------
#region Generated Events
#----------------------------------------------

$Form_StateCorrection_Load =
{
#Correct the initial state of the form to prevent the .Net maximized form issue
$formChooseOU.WindowState = $InitialFormWindowState
}

$Form_Cleanup_FormClosed =
{
#Remove all event handlers from the controls
try
{
$treeview1.remove_AfterLabelEdit($CreateOU)
$buttonOK.remove_Click($buttonOK_Click)
$formChooseOU.remove_Load($FormEvent_Load)
$formChooseOU.remove_Load($Form_StateCorrection_Load)
$formChooseOU.remove_FormClosed($Form_Cleanup_FormClosed)
}
catch [Exception]
{ }
}
#endregion Generated Events

#----------------------------------------------
#region Generated Form Code
#----------------------------------------------
#
# formChooseOU
#
$formChooseOU.Controls.Add($treeview1)
$formChooseOU.Controls.Add($buttonOK)
$formChooseOU.AcceptButton = $buttonOK
$formChooseOU.ClientSize = '342, 502'
$formChooseOU.FormBorderStyle = 'FixedDialog'
#region Binary Data
$formChooseOU.Icon = [System.Convert]::FromBase64String('
AAABAAkAICAQAAEABADoAgAAlgAAABgYEAABAAQA6AEAAH4DAAAQEBAAAQAEACgBAABmBQAAICAA
AAEACACoCAAAjgYAABgYAAABAAgAyAYAADYPAAAQEAAAAQAIAGgFAAD+FQAAICAAAAEAIACoEAAA
ZhsAABgYAAABACAAiAkAAA4sAAAQEAAAAQAgAGgEAACWNQAAKAAAACAAAABAAAAAAQAEAAAAAAAA
AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAACAgIAAwMDAAAAA
/wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAiIAAAAAAAAAAAAAAAACIiIiHMAAAAAAAAAAAAAiI//iIiHcAAAAAAAAAAIiP//+IiIiH
dwAAAAAAiI//////iIiIiHhwAAAAAIj///////iIiIiHeHAAAACIj////4iIiIiIiIiHgAAAiIj/
iIiIiIj/iIiHeIcAAIiIiIiIiIiIiP+IiIeIcACIiHd3d3d3eIeI+IiHeIhwczMRMzd3czeIeI/4
iIiIcAczN3iIiIczeId4j4iHiHAACIiP///4i7OIh4iPiHiAAAAIiI//iIu7M4h3iP+HcAAAAAiI
iIi7u7u3iHiIiHAAAAAACIeP///4i7iHeIgAAAAAAAAAiI+IiLu7t3AAAAAAAAAAAACDMzMzMzM3
AAAAAAAAAAAAAAAAAAAACIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////////
///////8f///wB///gAP//AAA/8AAAH/AAAAfwAAAB8AAAAPAAAABwAAAAEAAAABgAAAAeAAAAH4
AAAB/gAAAf+AAAP/8AAf//wAD////+f/////////////////////KAAAABgAAAAwAAAAAQAEAAAA
AAAgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAACAgIAAwMDA
AAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIiIAAAAAAAA
AAAIiIiIcAAAAAAAAIiI/4iIhwAAAAAIiP//+IiIh3gAAACI/////4iHiHeAAACIj//4iIiIeIiI
AACIiIiIiIiPiIh4iACIiId4iIiI+IiHiHCHczMzd3eIiPiHeIeDAzd4h3M3iI+Id4gAiIj//4iz
eIiPh4gAAIiIiIu7M3iIiHcAAACIiIiIizeIiIcAAAAAiI//iLt3gAAAAAAAAIhzMzMzMAAAAAAA
AAAAAAAAdwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD/
w/8A/gH/APAA/wCAAD8AAAAfAAAADwAAAAMAAAABAAAAAA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AAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMAD
AADAAwAAwAMAAMADAADAAwAAwAMAAP//AAA=')
#endregion
$formChooseOU.MaximizeBox = $False
$formChooseOU.MinimizeBox = $False
$formChooseOU.Name = "formChooseOU"
$formChooseOU.StartPosition = 'CenterScreen'
$formChooseOU.Text = "Choose Active Directory OU"
$formChooseOU.add_Load($FormEvent_Load)
#
# buttonCancel
#
$ButtonCancel.text = "&Cancel"
$ButtonCancel.Location = '19,467'
$ButtonCancel.TabIndex = 2
$ButtonCancel.size = '75,23'
$ButtonCancel.Anchor = 'Bottom, Left'
$ButtonCancel.add_Click($ButtonCancel_Click)
#
# treeview1
#
$treeview1.ImageIndex = 0
$treeview1.ImageList = $imagelist1
$treeview1.Location = '19, 21'
$treeview1.Name = "treeview1"
$System_Windows_Forms_TreeNode_1 = New-Object 'System.Windows.Forms.TreeNode' ("Active Directory Hierarchy", 3, 3)
$System_Windows_Forms_TreeNode_1.ImageIndex = 3
$System_Windows_Forms_TreeNode_1.Name = "Active Directory Hierarchy"
$System_Windows_Forms_TreeNode_1.SelectedImageIndex = 3
$System_Windows_Forms_TreeNode_1.Tag = "root"
$System_Windows_Forms_TreeNode_1.Text = "Active Directory Hierarchy"
[void]$treeview1.Nodes.Add($System_Windows_Forms_TreeNode_1)
$treeview1.SelectedImageIndex = 0
$treeview1.Size = '301, 425'
$treeview1.TabIndex = 1
$treeview1.add_AfterLabelEdit($CreateOU)
#
# buttonOK
#
$buttonOK.Anchor = 'Bottom, Right'
$buttonOK.DialogResult = 'OK'
$buttonOK.Location = '245, 467'
$buttonOK.Name = "buttonOK"
$buttonOK.Size = '75, 23'
$buttonOK.TabIndex = 0
$buttonOK.Text = "OK"
$buttonOK.UseVisualStyleBackColor = $True
$buttonOK.add_Click($buttonOK_Click)
#
# imagelist1
#
$Formatter_binaryFomatter = New-Object System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
#region Binary Data
$System_IO_MemoryStream = New-Object System.IO.MemoryStream ( , [byte[]][System.Convert]::FromBase64String('
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAu
MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAA
ACZTeXN0ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkD
AAAADwMAAABwCgAAAk1TRnQBSQFMAgEBBAEAAUABAAFAAQABEAEAARABAAT/AQkBAAj/AUIBTQE2
AQQGAAE2AQQCAAEoAwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYAB
AAKAAgADwAEAAcAB3AHAAQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEA
AykBAANVAQADTQEAA0IBAAM5AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8B
AAHWAucBAAGQAakBrQIAAf8BMwMAAWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHM
AgABMwH/AgABZgMAAWYBMwIAAmYCAAFmAZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgAC
mQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHMAWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZ
AgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEAATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8B
MwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEzAWYCAAEzAWYBMwEAATMCZgEAATMBZgGZ
AQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZAWYBAAEzApkBAAEzAZkBzAEAATM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5AVIFmgF0Av8BmQGgC5oBdAL/AbwD
8wG8AZIBBwHvAQcB8QLzAfIB7QP/AZkCGgGgBJoCegF5AVID/wGZAaABmgJ5AXQCUgWaAXQC/wGZ
AaALmgF0Av8BvAEHAu8B9wPtAe8CBwLvAe0D/wGZARoBmgKZBnkBUgP/AZkBwwGaBHQBeQGgBJoB
dAL/AZkBwwaaAaAEmgF0Av8CvAIHAvcCBwO8AgcBkgP/AZkBGgGZAxoDmgFSAXkBUgP/AZkBwwOa
AqABmQWaAXQC/wGZAcMDmgKgAZkFmgF0Av8CvAHrAewCBwLzAfABvAHtAW0BBwH3A/8BmQEaAZkC
9gTDAVIBeQFSA/8BmQWgAZoCdAV5Av8BmQWgAZoCdAV5Av8BvAEHApIB7wH3ApIB7wG8Ae8BkgHv
AfcD/wGZAhoC9gTDAVgBeQFSA/8BmQGaBBoBdAOaApkBmgF5Av8BeQGaBBoBdAOaApkBmgF5Av8D
9AHyAbwB8QK8Ae8B8AT0A/8BmQMaApkDeQFYAXkBUgP/ARsGeQGaAvYB1gG0AZoBmQL/AZkGeQGa
AvYB1gG0AZoBeQX/AfQBvAH3ARIB7AHvAfAH/wFRARwBeQN0AVIEUQEqCf8BwwZ5AcMI/wGaBnkB
mgX/AfQBvAEHAu8B9wHxB/8MUUL/AUIBTQE+BwABPgMAASgDAAFAAwABIAMAAQEBAAEBBgABARYA
A///AAIACw=='))
#endregion
$imagelist1.ImageStream = $Formatter_binaryFomatter.Deserialize($System_IO_MemoryStream)
$Formatter_binaryFomatter = $null
$System_IO_MemoryStream = $null
$imagelist1.TransparentColor = 'Transparent'
#
# ErrorProviderOU
#
$ErrorProviderOU.ContainerControl = $formChooseOU
#endregion Generated Form Code

#----------------------------------------------

#Save the initial state of the form
$InitialFormWindowState = $formChooseOU.WindowState
#Init the OnLoad event to correct the initial state of the form
$formChooseOU.add_Load($Form_StateCorrection_Load)
#Clean up the control events
$formChooseOU.add_FormClosed($Form_Cleanup_FormClosed)
#Show the Form
return $formChooseOU.ShowDialog()

} #End Function

#Call OnApplicationLoad to initialize
if ((OnApplicationLoad) -eq $true)
{
#Call the form
Call-AD_OU_select_pff | Out-Null

#Perform cleanup
OnApplicationExit

#Output
$objSelectedOU
}
}

User avatar
Jcholder
Posts: 7
Joined: Wed Apr 22, 2015 5:50 pm

Re: OU Selector

Post by Jcholder » Sat Nov 05, 2016 11:32 pm

Nevermind, I think I found the solution here https://itmicah.wordpress.com/2016/03/2 ... revisited/

User avatar
jvierra
Posts: 13798
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: OU Selector

Post by jvierra » Sun Nov 06, 2016 5:30 am

Here is the fastest OU picker method available. It is a demo of how easy it is to load an OU tree and its objects and how to build it so no Active Directory module is needed. It is pure ADSI and uses almost no code to obtain the tree. It can be enhanced very easily with little effort.

Here is the total amount of functional code required to dynamically load a tree.

Code: Select all

$FormEvent_Load={

$rootCN=[adsi]''
$nodeName=$rootCN.Name
$key="LDAP://$($rootCN.DistinguishedName)"
$treeview1.Nodes.Add($key,$nodeName)
}


$treeview1_NodeMouseClick=[System.Windows.Forms.TreeNodeMouseClickEventHandler]{
if (-not $_.Node.IsExpanded) {
$thisOU = [adsi]$_.Node.Name
$nodename.Text = $thisOU.Name
$listbox1.DataSource = [collections.arraylist]@($thisOU.Children)
if (-not $_.Node.Nodes) {
$nodepath.Text = $thisOU.DistinguishedName
$searcher = [adsisearcher]'objectClass=organizationalunit'
$searcher.SearchRoot = $_.Node.Name
$searcher.SearchScope = 'OneLevel'
$searcher.PropertiesToLoad.Add('name')
$OUs = $searcher.Findall()
foreach ($ou in $OUs) {
$_.Node.Nodes.Add($ou.Path, $ou.Properties['name'])
}
}
$_.Node.Expand()
} else {
$_.Node.Collapse()
}
}
Notice no AD module. This can be run on any workstation that has PS 3 or later installed.

This was originally created to demonstrate how to dynamically load a Treeview as it is navigated. With a few lines of code the first level could just use the forest as the root and have all domains available.
Attachments
Demo-ADSITreeView.psf
(24.02 KiB) Downloaded 238 times

User avatar
Jcholder
Posts: 7
Joined: Wed Apr 22, 2015 5:50 pm

Re: OU Selector

Post by Jcholder » Sun Nov 06, 2016 6:25 pm

Awesome! Thank you very much

User avatar
jvierra
Posts: 13798
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: OU Selector

Post by jvierra » Sun Nov 06, 2016 6:54 pm

You are welcome. It is a starting point that demonstrates how to easily load a TreeView. It has some deficiencies that are easily remedied. The next steps all depend on what your particular requirement is. Icons and other bells and whistles are very easy to add and take very small amounts of code.

User avatar
dan.potter
Posts: 709
Joined: Wed Oct 08, 2014 6:02 am

Re: OU Selector

Post by dan.potter » Mon Nov 07, 2016 7:03 am

Jcholder wrote:Nevermind, I think I found the solution here https://itmicah.wordpress.com/2016/03/2 ... revisited/
That one had a couple issues Micah overlooked. I fixed them and posted on github. Jvierra's code is better but you can use the images in the attached.
adtree.psf
(28.16 KiB) Downloaded 213 times

Locked