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.
  1. $OU = Choose-ADOrganizationalUnit
  2.  
  3.     Try
  4.  
  5.     {
  6.  
  7.         $AdComputers = Get-ADComputer -LDAPFilter "(name=*)" -SearchBase $ou | Select-Object name, enabled, DNSHostName
  8.  
  9.         $AD_computers = New-Object System.Collections.ArrayList
  10.  
  11.         Foreach ($item in $AdComputers)
  12.  
  13.         {
  14.  
  15.             If (($item.enabled) -and ($item.DNSHostName -ne $null))
  16.  
  17.             {
  18.  
  19.                 $WSUS_Computers.AppendText("$($item.DNSHostName)`n")
  20.  
  21.                
  22.  
  23.             }
  24.  
  25.         }
  26.  
  27.     }
  28.  
  29.     catch
  30.  
  31.     {
  32.  
  33.         Write-Debug ($_ | Out-String)
  34.  
  35.         $WSUS_Computers.Text = "No computers found in OU"
  36.  
  37.     }
  1. function Choose-ADOrganizationalUnit
  2.  
  3. {
  4.  
  5.     #========================================================================
  6.  
  7.     # Code Generated By: SAPIEN Technologies, Inc., PowerShell Studio 2012 v3.1.24
  8.  
  9.     # Generated On: 29-10-2013 13:45
  10.  
  11.     # Generated By: Michaja van der Zouwen
  12.  
  13.     # Organization: -
  14.  
  15.     #========================================================================
  16.  
  17.     #----------------------------------------------
  18.  
  19.     #region Application Functions
  20.  
  21.     #----------------------------------------------
  22.  
  23.    
  24.  
  25.     function OnApplicationLoad
  26.  
  27.     {
  28.  
  29.         #Note: This function is not called in Projects
  30.  
  31.         #Note: This function runs before the form is created
  32.  
  33.         #Note: To get the script directory in the Packager use: Split-Path $hostinvocation.MyCommand.path
  34.  
  35.         #Note: To get the console output in the Packager (Windows Mode) use: $ConsoleOutput (Type: System.Collections.ArrayList)
  36.  
  37.         #Important: Form controls cannot be accessed in this function
  38.  
  39.         #TODO: Add snapins and custom code to validate the application load
  40.  
  41.        
  42.  
  43.         return $true #return true for success or false for failure
  44.  
  45.     }
  46.  
  47.    
  48.  
  49.     function OnApplicationExit
  50.  
  51.     {
  52.  
  53.         #Note: This function is not called in Projects
  54.  
  55.         #Note: This function runs after the form is closed
  56.  
  57.         #TODO: Add custom code to clean up and unload snapins when the application exits
  58.  
  59.        
  60.  
  61.         $script:ExitCode = 0 #Set the exit code for the Packager
  62.  
  63.     }
  64.  
  65.    
  66.  
  67.     #endregion Application Functions
  68.  
  69.    
  70.  
  71.     #----------------------------------------------
  72.  
  73.     # Generated Form Function
  74.  
  75.     #----------------------------------------------
  76.  
  77.     function Call-AD_OU_select_pff
  78.  
  79.     {
  80.  
  81.        
  82.  
  83.         #----------------------------------------------
  84.  
  85.         #region Import the Assemblies
  86.  
  87.         #----------------------------------------------
  88.  
  89.         [void][reflection.assembly]::Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
  90.  
  91.         [void][reflection.assembly]::Load("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
  92.  
  93.         [void][reflection.assembly]::Load("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  94.  
  95.         [void][reflection.assembly]::Load("System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
  96.  
  97.         [void][reflection.assembly]::Load("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
  98.  
  99.         [void][reflection.assembly]::Load("System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
  100.  
  101.         [void][reflection.assembly]::Load("System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  102.  
  103.         [void][reflection.assembly]::Load("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
  104.  
  105.         [void][reflection.assembly]::Load("System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  106.  
  107.         #endregion Import Assemblies
  108.  
  109.        
  110.  
  111.         #----------------------------------------------
  112.  
  113.         #region Generated Form Objects
  114.  
  115.         #----------------------------------------------
  116.  
  117.         [System.Windows.Forms.Application]::EnableVisualStyles()
  118.  
  119.         $formChooseOU = New-Object 'System.Windows.Forms.Form'
  120.  
  121.         $treeview1 = New-Object 'System.Windows.Forms.TreeView'
  122.  
  123.         $buttonOK = New-Object 'System.Windows.Forms.Button'
  124.  
  125.         $ButtonCancel = New-Object 'System.Windows.Forms.Button'
  126.  
  127.         $imagelist1 = New-Object 'System.Windows.Forms.ImageList'
  128.  
  129.         $ErrorProviderOU = New-Object 'System.Windows.Forms.ErrorProvider'
  130.  
  131.         $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
  132.  
  133.         #endregion Generated Form Objects
  134.  
  135.        
  136.  
  137.         #----------------------------------------------
  138.  
  139.         # User Generated Script
  140.  
  141.         #----------------------------------------------
  142.  
  143.        
  144.  
  145.         function Add-Node
  146.  
  147.         {
  148.  
  149.             param (
  150.  
  151.                 $selectedNode,
  152.  
  153.                 $dname,
  154.  
  155.                 $name,
  156.  
  157.                 $ou
  158.  
  159.             )
  160.  
  161.             $newNode = new-object System.Windows.Forms.TreeNode
  162.  
  163.             $newNode.Name = $dname
  164.  
  165.             $newNode.Text = $name
  166.  
  167.             IF ($ou -eq $false)
  168.  
  169.             {
  170.  
  171.                 $newnode.ImageIndex = 1
  172.  
  173.                 $newNode.SelectedImageIndex = 1
  174.  
  175.             }
  176.  
  177.             $selectedNode.Nodes.Add($newNode) | Out-Null
  178.  
  179.             If ($dname -eq $strDomainDN)
  180.  
  181.             {
  182.  
  183.                 $newNode.ImageIndex = 2
  184.  
  185.                 $newNode.SelectedImageIndex = 2
  186.  
  187.             }
  188.  
  189.             return $newNode
  190.  
  191.         }
  192.  
  193.        
  194.  
  195.         function Get-NextLevel
  196.  
  197.         {
  198.  
  199.             param (
  200.  
  201.                 $selectedNode,
  202.  
  203.                 $dn,
  204.  
  205.                 $name,
  206.  
  207.                 $OU
  208.  
  209.             )
  210.  
  211.            
  212.  
  213.             $OUs = Get-ADObject -Filter 'ObjectClass -eq "organizationalUnit" -or ObjectClass -eq "container"' -SearchScope OneLevel -SearchBase $dn
  214.  
  215.            
  216.  
  217.             If ($OUs -eq $null)
  218.  
  219.             {
  220.  
  221.                 $node = Add-Node $selectedNode $dn $name $OU
  222.  
  223.             }
  224.  
  225.             Else
  226.  
  227.             {
  228.  
  229.                 $node = Add-Node $selectedNode $dn $name $OU
  230.  
  231.                
  232.  
  233.                 $OUs | ForEach-Object {
  234.  
  235.                     If ($_.ObjectClass -eq "organizationalUnit")
  236.  
  237.                     {
  238.  
  239.                         $OU = $true
  240.  
  241.                     }
  242.  
  243.                     else
  244.  
  245.                     {
  246.  
  247.                         $OU = $false
  248.  
  249.                     }
  250.  
  251.                     Get-NextLevel $node $_.distinguishedName $_.name $OU
  252.  
  253.                 }
  254.  
  255.             }
  256.  
  257.         }
  258.  
  259.        
  260.  
  261.         function Build-TreeView
  262.  
  263.         {
  264.  
  265.             if ($treeNodes)
  266.  
  267.             {
  268.  
  269.                 $treeview1.Nodes.remove($treeNodes)
  270.  
  271.                 $formChooseOU.Refresh()
  272.  
  273.             }
  274.  
  275.            
  276.  
  277.             $treeNodes = $treeview1.Nodes[0]
  278.  
  279.            
  280.  
  281.             #Generate Module nodes
  282.  
  283.             Get-NextLevel $treeNodes $strDomainDN $strDNSDomain
  284.  
  285.            
  286.  
  287.             $treeNodes.Expand()
  288.  
  289.             $treeNodes.FirstNode.Expand()
  290.  
  291.         }
  292.  
  293.        
  294.  
  295.         $treeView1.add_AfterSelect({
  296.  
  297.                 $script:SelectedOU = $this.SelectedNode
  298.  
  299.             })
  300.  
  301.        
  302.  
  303.         $FormEvent_Load = {
  304.  
  305.             Import-Module ActiveDirectory
  306.  
  307.             $objIPProperties = [System.Net.NetworkInformation.IPGlobalProperties]::GetIPGlobalProperties()
  308.  
  309.             $strDNSDomain = $objIPProperties.DomainName.toLower()
  310.  
  311.             $strDomainDN = $strDNSDomain.toString().split('.'); foreach ($strVal in $strDomainDN) { $strTemp += "dc=$strVal," }; $strDomainDN = $strTemp.TrimEnd(",").toLower()
  312.  
  313.             Build-TreeView
  314.  
  315.         }
  316.  
  317.        
  318.  
  319.        
  320.  
  321.        
  322.  
  323.         $buttonOK_Click = {
  324.  
  325.             $script:objSelectedOU = Get-ADObject -Identity $SelectedOU.name
  326.  
  327.            
  328.  
  329.         }
  330.  
  331.         $ButtonCancel_Click = {
  332.  
  333.             $script:SelectedOU = $null
  334.  
  335.             $FormOU.close()
  336.  
  337.         }
  338.  
  339.        
  340.  
  341.         # --End User Generated Script--
  342.  
  343.         #----------------------------------------------
  344.  
  345.         #region Generated Events
  346.  
  347.         #----------------------------------------------
  348.  
  349.        
  350.  
  351.         $Form_StateCorrection_Load =
  352.  
  353.         {
  354.  
  355.             #Correct the initial state of the form to prevent the .Net maximized form issue
  356.  
  357.             $formChooseOU.WindowState = $InitialFormWindowState
  358.  
  359.         }
  360.  
  361.        
  362.  
  363.         $Form_Cleanup_FormClosed =
  364.  
  365.         {
  366.  
  367.             #Remove all event handlers from the controls
  368.  
  369.             try
  370.  
  371.             {
  372.  
  373.                 $treeview1.remove_AfterLabelEdit($CreateOU)
  374.  
  375.                 $buttonOK.remove_Click($buttonOK_Click)
  376.  
  377.                 $formChooseOU.remove_Load($FormEvent_Load)
  378.  
  379.                 $formChooseOU.remove_Load($Form_StateCorrection_Load)
  380.  
  381.                 $formChooseOU.remove_FormClosed($Form_Cleanup_FormClosed)
  382.  
  383.             }
  384.  
  385.             catch [Exception]
  386.  
  387.             { }
  388.  
  389.         }
  390.  
  391.         #endregion Generated Events
  392.  
  393.        
  394.  
  395.         #----------------------------------------------
  396.  
  397.         #region Generated Form Code
  398.  
  399.         #----------------------------------------------
  400.  
  401.         #
  402.  
  403.         # formChooseOU
  404.  
  405.         #
  406.  
  407.         $formChooseOU.Controls.Add($treeview1)
  408.  
  409.         $formChooseOU.Controls.Add($buttonOK)
  410.  
  411.         $formChooseOU.AcceptButton = $buttonOK
  412.  
  413.         $formChooseOU.ClientSize = '342, 502'
  414.  
  415.         $formChooseOU.FormBorderStyle = 'FixedDialog'
  416.  
  417.         #region Binary Data
  418.  
  419.         $formChooseOU.Icon = [System.Convert]::FromBase64String('
  420.  
  421.    AAABAAkAICAQAAEABADoAgAAlgAAABgYEAABAAQA6AEAAH4DAAAQEBAAAQAEACgBAABmBQAAICAA
  422.  
  423.    AAEACACoCAAAjgYAABgYAAABAAgAyAYAADYPAAAQEAAAAQAIAGgFAAD+FQAAICAAAAEAIACoEAAA
  424.  
  425.    ZhsAABgYAAABACAAiAkAAA4sAAAQEAAAAQAgAGgEAACWNQAAKAAAACAAAABAAAAAAQAEAAAAAAAA
  426.  
  427.    AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAACAgIAAwMDAAAAA
  428.  
  429.    /wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  430.  
  431.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  432.  
  433.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  434.  
  435.    AAAAAAAAiIAAAAAAAAAAAAAAAACIiIiHMAAAAAAAAAAAAAiI//iIiHcAAAAAAAAAAIiP//+IiIiH
  436.  
  437.    dwAAAAAAiI//////iIiIiHhwAAAAAIj///////iIiIiHeHAAAACIj////4iIiIiIiIiHgAAAiIj/
  438.  
  439.    iIiIiIj/iIiHeIcAAIiIiIiIiIiIiP+IiIeIcACIiHd3d3d3eIeI+IiHeIhwczMRMzd3czeIeI/4
  440.  
  441.    iIiIcAczN3iIiIczeId4j4iHiHAACIiP///4i7OIh4iPiHiAAAAIiI//iIu7M4h3iP+HcAAAAAiI
  442.  
  443.    iIi7u7u3iHiIiHAAAAAACIeP///4i7iHeIgAAAAAAAAAiI+IiLu7t3AAAAAAAAAAAACDMzMzMzM3
  444.  
  445.    AAAAAAAAAAAAAAAAAAAACIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  446.  
  447.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////////
  448.  
  449.    ///////8f///wB///gAP//AAA/8AAAH/AAAAfwAAAB8AAAAPAAAABwAAAAEAAAABgAAAAeAAAAH4
  450.  
  451.    AAAB/gAAAf+AAAP/8AAf//wAD////+f/////////////////////KAAAABgAAAAwAAAAAQAEAAAA
  452.  
  453.    AAAgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAACAgIAAwMDA
  454.  
  455.    AAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  456.  
  457.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIiIAAAAAAAA
  458.  
  459.    AAAIiIiIcAAAAAAAAIiI/4iIhwAAAAAIiP//+IiIh3gAAACI/////4iHiHeAAACIj//4iIiIeIiI
  460.  
  461.    AACIiIiIiIiPiIh4iACIiId4iIiI+IiHiHCHczMzd3eIiPiHeIeDAzd4h3M3iI+Id4gAiIj//4iz
  462.  
  463.    eIiPh4gAAIiIiIu7M3iIiHcAAACIiIiIizeIiIcAAAAAiI//iLt3gAAAAAAAAIhzMzMzMAAAAAAA
  464.  
  465.    AAAAAAAAdwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD/
  466.  
  467.    w/8A/gH/APAA/wCAAD8AAAAfAAAADwAAAAMAAAABAAAAAAAAAAAAwAAAAPAAAAD8AAAA/wAHAP/A
  468.  
  469.    BwD///MA////AP///wAoAAAAEAAAACAAAAABAAQAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  470.  
  471.    AAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICAgADAwMAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA
  472.  
  473.    ////AAAzMzMzMzMAAHd3d3MzMwAAd3d3czMzAACPiIiIiIMAAI+IiIiIgwAAj4iIiIiDAACPiIiI
  474.  
  475.    iIMAAI+IiIiIgwAAj4iIh3eDAACPj///94MAAI+P///3gwAAj4////eDAACPiIiId4MAAHd3d3Mz
  476.  
  477.    MwAAd3d3d3d3AAAAAAAAAAAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMA
  478.  
  479.    AMADAADAAwAAwAMAAMADAADAAwAA//8AACgAAAAgAAAAQAAAAAEACAAAAAAAAAQAAAAAAAAAAAAA
  480.  
  481.    AAEAAAABAAAAAAAAEj1BABlFSgAZSlIAIUpNAC5dXgAwV1kAMWRtAD9jaQA8aXoAVWttAFhpaQBK
  482.  
  483.    bnQATH5/AF16ewAAaZMACmuTAAl0mgA/eIIAHXqgACp+owBNd4EAS32LAGF9gAAShJgALouZADyG
  484.  
  485.    mQAKh6kAE4ujACWNqAA/jaMAMourAC6SrgAumbIAOJayAEmDjABEgpMAS4eQAFCHkABSiZIAVZOd
  486.  
  487.    AFmUngBhh4kAaIeMAGmMjQBnlZsAaZmbAHWUkwB7lJMAcJyfAHWdnwBQkKQAX5ujAEKfugBqnaEA
  488.  
  489.    UKK7AF2puwBpoaUAYqSqAGmlqQBvqq4AfaOsAHWprQB4q68Aaqm4AGqtvQB0rrIAea6xAHKxtgB5
  490.  
  491.    s7cAdbS4AHy1uQBzu74Adbm+AH64vAAXo8kAAKbUABSy1QAdtdkAHrvbACGjyQA4uM4ALL3eABi7
  492.  
  493.    4ABdssEATLbQAGOqwABmqsAAZq/AAGGtxQBqrcIAbrDBAHW8wQB5u8EAf73CAHy0yAB4v8oAZLfQ
  494.  
  495.    ADrB3wAp0t8APNDaAD7N5wA23OQAQsPfAEvO2AB5wcYAf8DEAHzCygBuw9YAdsTUAGPQ2QB92NwA
  496.  
  497.    RsTgAE3J4QBH3OsAUtDqAF7b7QBh1ecAWPz/AH3k8QB7//8AgKmqAImtsQCCsrQAhLa9AI67uwCR
  498.  
  499.    ubwAmMC+AIe+xgCLvMQAgrjKAJy/xgCQv8oAgL7SAIi90ACCwcYAi8PHAITFzACNxMgAi8PNAIjH
  500.  
  501.    zACEys8AiMnOAJTAwQCXxsgAm8bIAJvIzACGzdIAhs3UAI7J0ACIzNAAjs3SAJjD0QCTyNQAh9DU
  502.  
  503.    AIvQ0wCI0tYAjdHVAIvS2ACP1NoAjNnfAJHS1gCd09QAk9XZAJvV2gCT2NoAlNjaAJHY3ACU2NwA
  504.  
  505.    os3ZALLO0gCk09YArNHTAK7W2QCs298AstPWALHV2wCO2uAAk9vgAJXb4ACV3OEAl9/kAJzd5ACq
  506.  
  507.    0eAAq9XgAKLZ4wCg3+YAqN7hAKjY5ACu2uUAqdznALDT4QC11eMAs9nlAJng5ACd4ucAneTnAJ3h
  508.  
  509.    6gCe5uoAn+fsAI/s8wCd8vsAm///AKrg5ACi5+wAquToAKzl6wCl6e4AtOPpALrk6wC26+4At+zu
  510.  
  511.    ALzq7QCk6/AAquvwAKjt8QCx7fEAuO3wAKrw8gCq8PYArPL3AK319gCm8fgArvP4ALXw8wC28/YA
  512.  
  513.    vfHzALvy9gC09foAs/r+ALz//wDI19wAw9zoAMHq7QDF6e8AwuzuAN7u7wDD7fAAxu3wAMju8ADC
  514.  
  515.    8fMAx/HzAMjx8gDJ8vUAzPP2AM329gDP+PcAxff6AMP8/wDK/PwA2PD0ANH//wDY//8A6P//APL/
  516.  
  517.    /wD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  518.  
  519.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  520.  
  521.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  522.  
  523.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  524.  
  525.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  526.  
  527.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC3uW0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6MC3ztfa
  528.  
  529.    pS0JAAAAAAAAAAAAAAAAAAAAAAAAAADAwdHu8u/Z19eTjHlBAAAAAAAAAAAAAAAAAAAAAMC96fL2
  530.  
  531.    8vLu6dLX15OaoC8rWQAAAAAAAAAAAADAvb3u8vLy8vLy8u7p2Nfak5OcXjJ9WwAAAAAAAAAAAMXa
  532.  
  533.    4fDy8vLy8vLy8uLXw7NIaZOeoBcwlVkAAAAAAAAAw9fX4fDw8vLy8tTLpZyew8WTXImeh0V7j0GG
  534.  
  535.    AAAAAADD2tfa5OLS0L2koaXD19rf5eXFa1ycsQ4sooFZAAAAALna18WzpZyJaYeJiYeHh4eVz+Xk
  536.  
  537.    pVxrlUdDjI9BAAAAw7OTazolIyYnJygpNDtCSkVCw9/l14lpjQs+nH98WgBBEgcDAQEEBggMFRYk
  538.  
  539.    Gh44rZA5ic/l5bNpRkpHjo8/AAAnAwIFDS57kaytq4lUIRs1qa8+PKXa5dqcSApHnkQAAAAAgWCN
  540.  
  541.    zvn7+/n45Ml3c05LYbB+NofM3+XFXkSHSAAAAAAAANBrgK739+TeyHd0ZVNMUIWqMjyl1+Xlnio7
  542.  
  543.    AAAAAAAAAADQjHyk13d1cXBnYlJPTVWYejaHw9fapToAAAAAAAAAAAAA6YlZmfr+/v385sp4dnJs
  544.  
  545.    g3lCiJKsAAAAAAAAAAAAAAAAAACJhOfs1MNvbmhkZmNRNz0AAAAAAAAAAAAAAAAAAAAAAAAAYBkY
  546.  
  547.    HB0gIh8UExEPEDMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX4IAAAAAAAAAAAAAAAAA
  548.  
  549.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  550.  
  551.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  552.  
  553.    AAAAAP/////////////////////////////////////////////////8f///wB///gAP//AAA/8A
  554.  
  555.    AAH/AAAAfwAAAB8AAAAPAAAABwAAAAEAAAABgAAAAeAAAAH4AAAB/gAAAf+AAAP/8AAf//wAD///
  556.  
  557.    /+f/////////////////////KAAAABgAAAAwAAAAAQAIAAAAAABAAgAAAAAAAAAAAAAAAQAAAAEA
  558.  
  559.    AAAAAAAKNjwAH0tOACFQVgAsWV8AIFdhAClcZAA4ZGwAQGxuAEBtdQARaIMAMnePAEJ0gQBFf4YA
  560.  
  561.    QnuJAAuBnwAcgp0AH5CuADOMpAA5i6EAKJSvAC2arAAsmbEAIZu7ADuuvgBEgo8AXoqMAFCQmwBV
  562.  
  563.    k5wAX5CfAF+WnABjhIUAYYeKAG2XmQBmmJsAeZaVAHaZmgBIl6cARp+rAEafrABYkKEAWZWlAGOZ
  564.  
  565.    pwBgnqoAaKGnAGyqrwB/oKEAeqKlAHSnqwB7o6wAe6WvAHCorQB3q68Abq61AHajswBxqrIAdKyy
  566.  
  567.    AHevtQByrrgAd6+8AG+yuQB9srYAcLO5AHO0ugB5tLkAeLu/AH64vQACmsUAErjdACi52gBur8AA
  568.  
  569.    d7fDAHe9wgB3vsQAe7rAAHm9wwB8uMQAfL/GAHq5zAB6vtEAM8XOADzM5gA80uYAfsHFAH7DyAB8
  570.  
  571.    wcwAf8TOAF/a6wBj2u4AaNnqAHra7QBV9PUAfebwAIyvsQCArr0AgLK2AIqxsgCJsrcAkLW6AJO4
  572.  
  573.    vwCMvsAAlr7CAI7CwgCBxcoAh8fJAIPHzACKx8wAg8rOAIvKzwCMys0AmMLFAJ7GxQCRxMkAnsLM
  574.  
  575.    AJrFzACSyc0Als3OAJ3JyACCwNUAgsrRAITL0ACHzNcAi83SAI3N0QCLztQAjM7bAJHP0QCZyNIA
  576.  
  577.    n8nRAJvJ1ACO0NUAj9PfAIzX3QCe0NAAkdXaAJTX3QCd1NgAn9bfAJTZ2wCR2NwAlNndAKLI0gCj
  578.  
  579.    ytUApcrUAKzJ0wCwy9YApNDXAKbW2wCq1dwAu9beAIXV4gCB2esAhNrrAIrc6gCa1uAAl9vgAJbc
  580.  
  581.    4QCZ3+MAm9vlAJjf5ACk3OAAqt3jALXd4wCb4+cAnOLlAJ7k6QCY7vcAgfPzAKfh5QCg4ukAp+fr
  582.  
  583.    AKbm7ACq4eoApOrvAKft7wCq7O8AtubqALDj7QC44usAueXoALbq6wC37O8Av+nrALvp7wCm6/EA
  584.  
  585.    pOzwAKju8gCq7/QAs+zwALnv9ACu8PMAq/H0AKzx9QCt9/UAo/D4AK7z+QCv9PgAsvD0ALj3/ACy
  586.  
  587.    +f0Atfr9ALX8/wDK4OYAxOvuAMXt8QDB8PIAwvP0AMT09QDJ8PEAzPLzAMny9QDM8/cAyPb2AM32
  588.  
  589.    9gDO+PgAyv3/ANP9+gDT//8A7vHyAPf7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  590.  
  591.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  592.  
  593.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAA
  594.  
  595.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  596.  
  597.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  598.  
  599.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlYF5XgAAAAAAAAAAAAAAAAAA
  600.  
  601.    AAAAkXGBoK6kQh0AAAAAAAAAAAAAAAAAkI2UttHRtbuLQmYqAAAAAAAAAAAAjY2izNHW0dHLvMCL
  602.  
  603.    QGsjOXYAAAAAAACewM/R0dHR0dHPqptCM1SEJC5PAAAAAAClwMXP0dHMs5NtaXybaTx5aT1gTAAA
  604.  
  605.    AACqwLuvqIhzanybrrvDyZ4/SHkfZHBOAACqu5tMPzU1P0xTaX6LpcnDUz9rIV91RgBHHA0GAwQH
  606.  
  607.    CQwOGRxfc4vAyYtIIjNtbzqSBQECCBouXWA5JRATMW98pMm4aS0ggkIAAHFUh7XR2dbGpllFFyli
  608.  
  609.    cIe7yYssQEwAAAAAtpqhsL3CXFdRREMSMWVtnru4MB0AAAAAAACziISWmZiYWlhSGCtjhXx8bTkA
  610.  
  611.    AAAAAAAAALB9ytrb2cCnW1AmOoEAAAAAAAAAAAAAAAAArFQmFRYWFBEPCgsAAAAAAAAAAAAAAAAA
  612.  
  613.    AAAAAAAAAAAAADYpAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  614.  
  615.    AAAAAAD///8A////AP///wD///8A////AP///wD/w/8A/gH/APAA/wCAAD8AAAAfAAAADwAAAAMA
  616.  
  617.    AAABAAAAAAAAAAAAwAAAAPAAAAD8AAAA/wAHAP/ABwD///MA////AP///wAoAAAAEAAAACAAAAAB
  618.  
  619.    AAgAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAABfggAljaMALZClADaTpgA/l6gAQouhAEma
  620.  
  621.    qgBTnqsAXKKtAGalrwBvqbEAeKyyADOixQBBrMsAQ63MAEWvzQBGsM4ASbLPAFC10QBZudMAW7zV
  622.  
  623.    AGe/1wBowtkAdsXbAHfI3QBo0OYAcNPoAHnW6QCGzN8Ahc7kAIjP4QCC2usAjN3tAJnT4wCb1uUA
  624.  
  625.    n9XlAKTY5wCq2+gAr93qAJbh7gCf5fAAqejyALLs9AC77/UAvP//AMX//wDP//8A2f//AOL//wDs
  626.  
  627.    //8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  628.  
  629.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  630.  
  631.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  632.  
  633.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  634.  
  635.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  636.  
  637.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  638.  
  639.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  640.  
  641.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  642.  
  643.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  644.  
  645.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  646.  
  647.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  648.  
  649.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  650.  
  651.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  652.  
  653.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  654.  
  655.    AAAAAAAAAAAAAAAAAAAAAAAAAAAA////AAAAAQEBAQEBAQEBAQEBAAAAAAYMCwoJCAcFBAMCAQAA
  656.  
  657.    AAAGDAsKCQgHBQQDAgEAAAAAHiwrKikoISAcGxoNAAAAAB4sKyopKCEgHBsaDQAAAAAeLCsqKSgh
  658.  
  659.    IBwbGg0AAAAAHiwrKikoISAcGxoNAAAAAB4sKyopKCEgHBsaDQAAAAAeLCIdGBYUExEOGg0AAAAA
  660.  
  661.    HiwiMjEwLy4tDhoNAAAAAB4sJTIxMC8uLQ4aDQAAAAAeLCYyMTAvLi0RGg0AAAAAHiwmIh8ZFxQT
  662.  
  663.    EhoNAAAAAAYMCwoJCAcFBAMCAQAAAAAGBgYGBgYGBgYGBgYAAAAAAAAAAAAAAAAAAAAAAADAAwAA
  664.  
  665.    wAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAAD/
  666.  
  667.    /wAAKAAAACAAAABAAAAAAQAgAAAAAACAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  668.  
  669.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  670.  
  671.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  672.  
  673.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  674.  
  675.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  676.  
  677.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  678.  
  679.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  680.  
  681.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  682.  
  683.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  684.  
  685.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  686.  
  687.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  688.  
  689.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  690.  
  691.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  692.  
  693.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  694.  
  695.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  696.  
  697.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  698.  
  699.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  700.  
  701.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  702.  
  703.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  704.  
  705.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  706.  
  707.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  708.  
  709.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdKbGAYG0zTSOwtRUhLzS
  710.  
  711.    r5zX4e1qv9HqCF59egAnQg4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  712.  
  713.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgbHMQI2+1IaY
  714.  
  715.    xtiyqNTf9Kzl6/+p7vH/qvHy/5PY2v9nlZv/ADtSww9tjTMAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  716.  
  717.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaJ/CA4y91CR/tM5JjL3U
  718.  
  719.    pafU4dy45Ov3xu3x/8rx8v/I7vD/uO3w/6nt8f+o7PH/hs7T/4jHzP+Aqqr/YKq67wd5oHsAR2YK
  720.  
  721.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbaLBPoa4z26R
  722.  
  723.    wtasqtjk8cDq7v/K8/X/z/j3/8z29v/J8vP/xu3w/8Pr7f+26+7/qOzw/6jt8f+HztL/h9DU/43a
  724.  
  725.    3/91lJP/aIeM/yqRsb0AX4s3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf7jO
  726.  
  727.    nJLP3sul2+bzw+3w/8329v/O9vf/zPP2/8ry9f/I8vX/yfL1/8jx8v/H7vH/wuzu/7Ht8f+p7vL/
  728.  
  729.    qvDz/4bN0P+HztP/idLW/3+9wv91nZ//jru7/2Orve0Dc5t7AE9zCQAAAAAAAAAAAAAAAAAAAAAA
  730.  
  731.    AAAAAAAAAAAAAACd4er/rvX2/7bz9v/D8vP/yfPz/8jy9f/I8fP/yfP1/8ny9f/J8vX/yfHz/8jw
  732.  
  733.    8v+98fP/quvw/53i5/+V2+D/c7u+/3nBxv+HztP/i9PY/4zZ3/9hfYD/e5ST/47J0P81kK3BAGiQ
  734.  
  735.    NgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJvf5/mp7vL/qu7z/7Xw8//B8fP/x/Hz/8rz9v/M8/f/
  736.  
  737.    yvP2/8jy8/++6+7/quDk/5TY2v+M09b/j9Xb/5ng5f+f5+z/h87U/3S7wf+Ax87/i9LY/4LCx/95
  738.  
  739.    srf/gbK1/5XBwv9ep7rqFH6kgQAAAAMAAAAAAAAAAAAAAAAAAAAAm97m+anw8v+p7vP/rPL3/7X2
  740.  
  741.    +P+78vb/t+zu/7Tm6v+o3uH/mdXZ/5HS1v+T2Nv/neTn/6bt8v+q8Pb/r/P4/7L4/v+1/P//n+br
  742.  
  743.    /3zDyP93vsP/iNLW/47a4P9denv/aYyN/53T1P+Mu8H/Mo+swQBqkzcAAAAAAAAAAAAAAACe3+b5
  744.  
  745.    q/Dz/6jt8v+f5ur/l9/k/5LY3f+L0NP/hMbK/3/AxP+Dwsb/h8bL/4bHyv+ExMf/hMLG/4PAxf+F
  746.  
  747.    wsb/js3S/6bp7v+0+///sPf8/5HY3P90u8H/fcbM/4jM0P98tbj/ea6x/43EyP+XwMD/Y6i58QB1
  748.  
  749.    n38AVnUJAAAAAJ7e5fqT2+D/hs3U/3rCyf9hoqr/S4eQ/0mDjP9Qh5D/UIiS/1OMlf9Vk53/WZSe
  750.  
  751.    /1+bo/9ppKj/dK6y/365vP95tLf/dK+0/5rc4f+v8/j/t/7//6Xs8P+Axsz/ecHH/4PMz/9YaWn/
  752.  
  753.    dqqu/47Q1f+YwL7/h7e9/yuLqbMAAAAKaqm4/z94gv8xZG3/G0tT/xA7Qf8VP0L/IUpN/zBXWf8/
  754.  
  755.    Y2n/Sm50/013gf9LfYv/RIKT/zyGmf8/jaP/Xam7/67W2/+Xxsj/aaGl/4XDyP+k6u7/sfj9/7L5
  756.  
  757.    /v+V3OH/ecLH/3W0uP9/uLz/fLa7/4jJzv+SwML/d6uv/QAAACqCy9NpPHiA3hhKUf8ZRUr/Ll1e
  758.  
  759.    /0x+f/9pmZv/g7K0/5vGyP+r0NL/rtbY/6TT1v+Hxs3/XbLB/y6Zsv8Kh6n/Qp+6/6LN2f+y09b/
  760.  
  761.    dais/2+prv+U2Nz/qvD1/7X7//+r8vf/iNLW/3S6vv9Va23/fLW4/4/V2/9ur7X2AAAAKAAAAACm
  762.  
  763.    7fMEh8zVZGeqtsJ5v8n/hsjP/6rk6P/J+vr/0P///9L////M/v//w/z//7T3/v+d8vv/f+bz/1LQ
  764.  
  765.    6v8dtdn/F6PJ/2S30P+x1dv/kbm8/2icof+AwMT/oufs/671+P+1+///nufr/3m7wf9xsbb/hcLH
  766.  
  767.    /3O3vPZNTU0qAAAAAAAAAAAAAAAAktbfAqLq9UyQ1d6tf8DL/4e+xv+s29//x/f5/8P3+/+38/n/
  768.  
  769.    pvH4/4/s8/955fD/Xtvt/z7N5/8Yu+D/AKbU/yGjyf+AvtL/ss7S/3Ccn/9vq67/k9fa/6br8P+0
  770.  
  771.    +f7/svz//4/U2P9hh4n/ZqSp+MHBwUEAAAAAAAAAAAAAAAAAAAAAAAAAAKvt8wKw8PUuktPeqIK+
  772.  
  773.    yeuCtr3/ntXc/6Do8f9/4vD/YdXn/03J4f9GxOD/QsPf/zrB3/8svd7/Hrvb/xSy1f9MttD/mMPR
  774.  
  775.    /4mtsf9snqH/gMLG/5rg5P+m7PH/rPX3/5PU2P9kpqv/x8fHHAAAAAAAAAAAAAAAAAAAAAAAAAAA
  776.  
  777.    AAAAAAAAAAAAAAAAn+LtKI7U4YF4v8voZq/A/5PI1P/Y8PT/8v////P////o////2P///7z///+b
  778.  
  779.    ////e////1j8//9H3Ov/bsPW/5y/xv9/p6r8b6qv83O3vNJorLKoY6mvhF+lq3MAAAAAAAAAAAAA
  780.  
  781.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJLi7B6C1uFpc7rI3pC/yv/I19z/3u7v
  782.  
  783.    /7vq7P+Z4OT/fdjc/2PQ2f9Lztj/PNDa/zbc5P8p0t//OLjO/0yguvg6c4GnRHB1aDxiZwsAAAAA
  784.  
  785.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  786.  
  787.    AAAAWsbXZUuqur8ui5n/EoSY/wmGn/QDe5vcAHud0QB5nccAb5fNAGWR1QBplOIAb5f2AGmT/wpr
  788.  
  789.    k/8pd5DQMm5+eAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  790.  
  791.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAVdLfA0CxxkQmjq5FKIuwNSiGriIukrgaM5vBEiqTuhYig7Ad
  792.  
  793.    I4ayJwxxoDcOdKRBIIWvWBp8n5Ecf6CMHoGlKgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  794.  
  795.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  796.  
  797.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  798.  
  799.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  800.  
  801.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  802.  
  803.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  804.  
  805.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  806.  
  807.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  808.  
  809.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  810.  
  811.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////
  812.  
  813.    ////////////////////4B///4AP//AAA//AAAH/AAAAfwAAAD8AAAAPAAAABwAAAAEAAAAAAAAA
  814.  
  815.    AAAAAACAAAAA4AAAAPgAAAD/AAAB/8AAB//4AAf//AAD/////////////////////ygAAAAYAAAA
  816.  
  817.    MAAAAAEAIAAAAAAAYAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  818.  
  819.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  820.  
  821.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  822.  
  823.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  824.  
  825.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  826.  
  827.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  828.  
  829.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  830.  
  831.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  832.  
  833.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  834.  
  835.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABCcHgCQnB4BQAA
  836.  
  837.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  838.  
  839.    AAAAAAAAAAAAgbLNAYCyzRFzpLpLfLC/g4e+zNOBytXyIXGMkQBFbBMAAAAAAAAAAAAAAAAAAAAA
  840.  
  841.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGuesySBr7xSe6m7mIe0wc6d
  842.  
  843.    yND4pNzg/6ft7/+c4uX/fri9/ydpfbwUmMMxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  844.  
  845.    AAAAAAAAQnB4CF+QozJmma1of628pY68ydCq1dz+v+nr/8zy8//K8PH/t+zv/6ru8/+R2N3/fri9
  846.  
  847.    /47Cwv9Rjp3kE4OvYgB2rgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABso7R7erHAq5PBztey3OL0
  848.  
  849.    xOzw/8/29//O+Pj/zPX1/8jw8v/E6+7/s+zw/6zy9v+U2t3/erS5/4PKzf95lpX/da60+jeavJ8A
  850.  
  851.    dqoaAAAAAAAAAAAAAAAAAAAAAAAAAACZ2+X4rvDz/8T09f/O9/b/y/P2/8ry9f/J8vX/yvL1/8rw
  852.  
  853.    8v/B8PL/p+fr/5fb4P94u7//cKit/37DyP+M193/dpma/3+gof9csMfPB4GwRAAAAAAAAAAAAAAA
  854.  
  855.    AAAAAACf5Or+q/H0/7Lw9P/C8/T/yPP1/8zz9//G7/L/ueXo/6bW2/+Mys7/g8fM/4vO1P+W3OH/
  856.  
  857.    gcXL/2+yuf+CytH/g8TJ/32ytv+KsbL/c7PA7iqUuH4gj7QJAAAAAAAAAACf4un6rfL1/6nv9P+q
  858.  
  859.    7O//p+Hl/53U2P+Syc3/isfM/4zN0f+X3eD/pOrv/6nt8v+u8/n/tfz//5nf4/9ztLr/d73C/4TL
  860.  
  861.    0P9jhIX/jL7A/5LEyf88mbWtAYCxKgAAAACl5uz6qO/z/5bd4/98v8b/cLO5/2+vtv9trrX/c7S7
  862.  
  863.    /3m9w/9+wMT/h8fJ/5HP0f+U2dv/neTp/7X6/f+v9Pj/f8LH/3Czuv+Dy8//bZeZ/4Gztv+dycj/
  864.  
  865.    WaS33hOIslF3t8P/VZOc/0V/hv8pXGT/IVBW/yxZX/84ZGz/QG11/0J0gf9Ce4n/RIKP/1CQm/+A
  866.  
  867.    sbb/ls3O/5HY3P+s8fX/s/r+/5TZ3v93vsT/Zpib/3err/+Lys//nsbF/2qptPButL+fH1Zg/Qo2
  868.  
  869.    PP8fS07/QGxu/16KjP96oqX/jK+x/4myt/9xqrL/SJen/xyCnf85i6H/e6Os/5jCxf+LzdL/m+Pn
  870.  
  871.    /7L4/f+m6/H/gMbL/2yqr/9hh4r/jtDV/324vf2L1NsGkNXcOGWnsqd7ws32lNfd/7bq6//I9vb/
  872.  
  873.    0////8r9//+49/z/mO73/2jZ6v8oudr/IZu7/1mVpf+Qtbr/kMXJ/5HV2v+o7/P/s/r+/5LY3P9o
  874.  
  875.    oaf/eLS5/3a4vvUAAAAAAAAAAAAAAACj6vU+l97nppPT3u2q3eP/tubq/7nv9P+j8Pj/febw/1/a
  876.  
  877.    6/88zOb/Erjd/wKaxf8zjKT/e6Wv/5a+wv+My8z/mN/k/6vv9P+k7PD/dKer/1+WnP8AAAAAAAAA
  878.  
  879.    AAAAAAAAAAAAAAAAAKLk7EKQ0+GjltPc6Y/T3/+F1eL/itzq/4Ta6/+B2ev/etrt/2Pa7v880ub/
  880.  
  881.    O66+/2Ceqv+TuL//ntDQ/o7O0f+MztP8g8XK6WCgp94AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  882.  
  883.    AAAAj9jlPXzR4ZmFy9nvyuDm/+7x8v/3+/v/0/36/6339f+B8/P/VfT1/zPFzv9Gn6v/dq+8/WCq
  884.  
  885.    uaNtr7NVZairOF6lqigAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB+z98zcM3c
  886.  
  887.    l3G8yOpGn6z/LZqs/x6Squ0SjqriDoem4wyHqOsHf576EWiD/xVkgN81i6RnAAAAAAAAAAAAAAAA
  888.  
  889.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWc/fBUPD0zEgj6pmG4GkUxyBqTgm
  890.  
  891.    kLYsIouzKxx5pzUTdaNGB2eRYBplgZgZZn65GXOUViWFpgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  892.  
  893.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  894.  
  895.    AB1DSAQdQ0gaHUNIGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  896.  
  897.    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/
  898.  
  899.    //8A////AP///wD///8A////AP/z/wD+Af8A+AD/AIAAPwAAAB8AAAAPAAAAAwAAAAEAAAAAAAAA
  900.  
  901.    AAAAAAAAAAAAAOAAAAD4AAAA/gAAAP+AAwD/wAAA///xAP///wAoAAAAEAAAACAAAAABACAAAAAA
  902.  
  903.    AEAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX4L/AF+C/wBfgv8AX4L/AF+C/wBfgv8AX4L/
  904.  
  905.    AF+C/wBfgv8AX4L/AF+C/wBfgv8AAAAAAAAAAAAAAAAAAAAAQouh/3issv9vqbH/ZqWv/1yirf9T
  906.  
  907.    nqv/SZqq/z+XqP82k6b/LZCl/yWNo/8AX4L/AAAAAAAAAAAAAAAAAAAAAEKLof94rLL/b6mx/2al
  908.  
  909.    r/9coq3/U56r/0maqv8/l6j/NpOm/y2Qpf8ljaP/AF+C/wAAAAAAAAAAAAAAAAAAAACFzuT/u+/1
  910.  
  911.    /7Ls9P+p6PL/n+Xw/5bh7v+M3e3/gtrr/3nW6f9w0+j/aNDm/zOixf8AAAAAAAAAAAAAAAAAAAAA
  912.  
  913.    hc7k/7vv9f+y7PT/qejy/5/l8P+W4e7/jN3t/4La6/951un/cNPo/2jQ5v8zosX/AAAAAAAAAAAA
  914.  
  915.    AAAAAAAAAIXO5P+77/X/suz0/6no8v+f5fD/luHu/4zd7f+C2uv/edbp/3DT6P9o0Ob/M6LF/wAA
  916.  
  917.    AAAAAAAAAAAAAAAAAACFzuT/u+/1/7Ls9P+p6PL/n+Xw/5bh7v+M3e3/gtrr/3nW6f9w0+j/aNDm
  918.  
  919.    /zOixf8AAAAAAAAAAAAAAAAAAAAAhc7k/7vv9f+y7PT/qejy/5/l8P+W4e7/jN3t/4La6/951un/
  920.  
  921.    cNPo/2jQ5v8zosX/AAAAAAAAAAAAAAAAAAAAAIXO5P+77/X/mdPj/4bM3/92xdv/Z7/X/1m50/9Q
  922.  
  923.    tNH/R7DO/0Gsy/9o0Ob/M6LF/wAAAAAAAAAAAAAAAAAAAACFzuT/u+/1/5/V5f/s////4v///9n/
  924.  
  925.    ///P////xf///7z///9Drcz/aNDm/zOixf8AAAAAAAAAAAAAAAAAAAAAhc7k/7vv9f+k2Of/7P//
  926.  
  927.    /+L////Z////z////8X///+8////Ra/N/2jQ5v8zosX/AAAAAAAAAAAAAAAAAAAAAIXO5P+77/X/
  928.  
  929.    qtvo/+z////i////2f///8/////F////vP///0awzv9o0Ob/M6LF/wAAAAAAAAAAAAAAAAAAAACF
  930.  
  931.    zuT/u+/1/6/d6v+b1uX/iM/h/3fI3f9owtn/W7zV/1G20v9Jss//aNDm/zOixf8AAAAAAAAAAAAA
  932.  
  933.    AAAAAAAAQouh/3issv9vqbH/ZqWv/1yirf9Tnqv/SZqq/z+XqP82k6b/LZCl/yWNo/8AX4L/AAAA
  934.  
  935.    AAAAAAAAAAAAAAAAAEKLof9Ci6H/Qouh/0KLof9Ci6H/Qouh/0KLof9Ci6H/Qouh/0KLof9Ci6H/
  936.  
  937.    Qouh/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  938.  
  939.    AAAAAAAAAAAAAAAAAAAAAAAAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMAD
  940.  
  941.    AADAAwAAwAMAAMADAADAAwAAwAMAAP//AAA=')
  942.  
  943.         #endregion
  944.  
  945.         $formChooseOU.MaximizeBox = $False
  946.  
  947.         $formChooseOU.MinimizeBox = $False
  948.  
  949.         $formChooseOU.Name = "formChooseOU"
  950.  
  951.         $formChooseOU.StartPosition = 'CenterScreen'
  952.  
  953.         $formChooseOU.Text = "Choose Active Directory OU"
  954.  
  955.         $formChooseOU.add_Load($FormEvent_Load)
  956.  
  957.         #
  958.  
  959.         # buttonCancel
  960.  
  961.         #
  962.  
  963.         $ButtonCancel.text = "&Cancel"
  964.  
  965.         $ButtonCancel.Location = '19,467'
  966.  
  967.         $ButtonCancel.TabIndex = 2
  968.  
  969.         $ButtonCancel.size = '75,23'
  970.  
  971.         $ButtonCancel.Anchor = 'Bottom, Left'
  972.  
  973.         $ButtonCancel.add_Click($ButtonCancel_Click)
  974.  
  975.         #
  976.  
  977.         # treeview1
  978.  
  979.         #
  980.  
  981.         $treeview1.ImageIndex = 0
  982.  
  983.         $treeview1.ImageList = $imagelist1
  984.  
  985.         $treeview1.Location = '19, 21'
  986.  
  987.         $treeview1.Name = "treeview1"
  988.  
  989.         $System_Windows_Forms_TreeNode_1 = New-Object 'System.Windows.Forms.TreeNode' ("Active Directory Hierarchy", 3, 3)
  990.  
  991.         $System_Windows_Forms_TreeNode_1.ImageIndex = 3
  992.  
  993.         $System_Windows_Forms_TreeNode_1.Name = "Active Directory Hierarchy"
  994.  
  995.         $System_Windows_Forms_TreeNode_1.SelectedImageIndex = 3
  996.  
  997.         $System_Windows_Forms_TreeNode_1.Tag = "root"
  998.  
  999.         $System_Windows_Forms_TreeNode_1.Text = "Active Directory Hierarchy"
  1000.  
  1001.         [void]$treeview1.Nodes.Add($System_Windows_Forms_TreeNode_1)
  1002.  
  1003.         $treeview1.SelectedImageIndex = 0
  1004.  
  1005.         $treeview1.Size = '301, 425'
  1006.  
  1007.         $treeview1.TabIndex = 1
  1008.  
  1009.         $treeview1.add_AfterLabelEdit($CreateOU)
  1010.  
  1011.         #
  1012.  
  1013.         # buttonOK
  1014.  
  1015.         #
  1016.  
  1017.         $buttonOK.Anchor = 'Bottom, Right'
  1018.  
  1019.         $buttonOK.DialogResult = 'OK'
  1020.  
  1021.         $buttonOK.Location = '245, 467'
  1022.  
  1023.         $buttonOK.Name = "buttonOK"
  1024.  
  1025.         $buttonOK.Size = '75, 23'
  1026.  
  1027.         $buttonOK.TabIndex = 0
  1028.  
  1029.         $buttonOK.Text = "OK"
  1030.  
  1031.         $buttonOK.UseVisualStyleBackColor = $True
  1032.  
  1033.         $buttonOK.add_Click($buttonOK_Click)
  1034.  
  1035.         #
  1036.  
  1037.         # imagelist1
  1038.  
  1039.         #
  1040.  
  1041.         $Formatter_binaryFomatter = New-Object System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
  1042.  
  1043.         #region Binary Data
  1044.  
  1045.         $System_IO_MemoryStream = New-Object System.IO.MemoryStream ( , [byte[]][System.Convert]::FromBase64String('
  1046.  
  1047.    AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAu
  1048.  
  1049.    MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAA
  1050.  
  1051.    ACZTeXN0ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkD
  1052.  
  1053.    AAAADwMAAABwCgAAAk1TRnQBSQFMAgEBBAEAAUABAAFAAQABEAEAARABAAT/AQkBAAj/AUIBTQE2
  1054.  
  1055.    AQQGAAE2AQQCAAEoAwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYAB
  1056.  
  1057.    AAKAAgADwAEAAcAB3AHAAQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEA
  1058.  
  1059.    AykBAANVAQADTQEAA0IBAAM5AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8B
  1060.  
  1061.    AAHWAucBAAGQAakBrQIAAf8BMwMAAWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHM
  1062.  
  1063.    AgABMwH/AgABZgMAAWYBMwIAAmYCAAFmAZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgAC
  1064.  
  1065.    mQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHMAWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZ
  1066.  
  1067.    AgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEAATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8B
  1068.  
  1069.    MwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEzAWYCAAEzAWYBMwEAATMCZgEAATMBZgGZ
  1070.  
  1071.    AQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZAWYBAAEzApkBAAEzAZkBzAEAATMB
  1072.  
  1073.    mQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLMAQABMwHMAf8BAAEzAf8BMwEA
  1074.  
  1075.    ATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEAAWYBAAFmAQABZgEAAZkB
  1076.  
  1077.    AAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEAAWYBMwHMAQABZgEz
  1078.  
  1079.    Af8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZAWYBAAFmApkB
  1080.  
  1081.    AAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/AQABZgH/
  1082.  
  1083.    AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEAAZkB
  1084.  
  1085.    AAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
  1086.  
  1087.    ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwB
  1088.  
  1089.    AAKZAf8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIA
  1090.  
  1091.    AZkB/wEzAQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYB
  1092.  
  1093.    AAHMAQABmQEAAcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEz
  1094.  
  1095.    Af8BAAHMAWYCAAHMAWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwB
  1096.  
  1097.    mQEzAQABzAGZAWYBAAHMApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEA
  1098.  
  1099.    A8wBAALMAf8BAAHMAf8CAAHMAf8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwB
  1100.  
  1101.    AAEzAQAB/wEAAWYBAAH/AQABmQEAAcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEA
  1102.  
  1103.    Af8BMwH/AQAB/wFmAgAB/wFmATMBAAHMAmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkC
  1104.  
  1105.    AAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZAcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHM
  1106.  
  1107.    AWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEzAQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8B
  1108.  
  1109.    AAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFmAQABIQEAAaUBAANfAQADdwEAA4YBAAOW
  1110.  
  1111.    AQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHwAfsB/wEAAaQCoAEAA4ADAAH/AgAB
  1112.  
  1113.    /wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD//8A/wD/AP8ABQAk/wL0Bv8D9AP/DPQD/wp0BHMC/wp0
  1114.  
  1115.    BHMC/wPsAesBbQH3Av8BBwLsAesBcgFtAfQC/wwqA/8BdAGaA3kBegd5AXMC/wF0AZoDeQF6B3kB
  1116.  
  1117.    cwL/AfcBBwGYATQBVgH3Av8BvAHvAQcBVgE5AXIB9AL/AVEBHAF0A3MFUQEqA/8BeQKaBUsFmgF0
  1118.  
  1119.    Av8BeQyaAXQC/wHvAQcB7wJ4AZIC8QMHAXgBWAHrAfQC/wF0ApkCeQN0A1IBKgP/AXkCmgFLA1EB
  1120.  
  1121.    KgWaAXQC/wF5DJoBdAL/Ae8CBwHvAZIC7AFyAe0CBwLvAewB9AL/AZkCGgGgBJoCegF5AVID/wF5
  1122.  
  1123.    AaABmgF5AZkCeQFRBZoBdAL/AXkBoAuaAXQC/wEHAe8C9wLtAXgBNQF4Ae8D9wHsAfQC/wGZAhoB
  1124.  
  1125.    oASaAnoBeQFSA/8BeQGgAZoCmQGgAXkBUgWaAXQC/wF5AaALmgF0Av8BBwPvAfcB7QGYAXgBmQEH
  1126.  
  1127.    A+8B7AP/AZkCGgGgBJoCegF5AVID/wGZAaABmgGZAXkBmgF5AVIFmgF0Av8BmQGgC5oBdAL/AbwD
  1128.  
  1129.    8wG8AZIBBwHvAQcB8QLzAfIB7QP/AZkCGgGgBJoCegF5AVID/wGZAaABmgJ5AXQCUgWaAXQC/wGZ
  1130.  
  1131.    AaALmgF0Av8BvAEHAu8B9wPtAe8CBwLvAe0D/wGZARoBmgKZBnkBUgP/AZkBwwGaBHQBeQGgBJoB
  1132.  
  1133.    dAL/AZkBwwaaAaAEmgF0Av8CvAIHAvcCBwO8AgcBkgP/AZkBGgGZAxoDmgFSAXkBUgP/AZkBwwOa
  1134.  
  1135.    AqABmQWaAXQC/wGZAcMDmgKgAZkFmgF0Av8CvAHrAewCBwLzAfABvAHtAW0BBwH3A/8BmQEaAZkC
  1136.  
  1137.    9gTDAVIBeQFSA/8BmQWgAZoCdAV5Av8BmQWgAZoCdAV5Av8BvAEHApIB7wH3ApIB7wG8Ae8BkgHv
  1138.  
  1139.    AfcD/wGZAhoC9gTDAVgBeQFSA/8BmQGaBBoBdAOaApkBmgF5Av8BeQGaBBoBdAOaApkBmgF5Av8D
  1140.  
  1141.    9AHyAbwB8QK8Ae8B8AT0A/8BmQMaApkDeQFYAXkBUgP/ARsGeQGaAvYB1gG0AZoBmQL/AZkGeQGa
  1142.  
  1143.    AvYB1gG0AZoBeQX/AfQBvAH3ARIB7AHvAfAH/wFRARwBeQN0AVIEUQEqCf8BwwZ5AcMI/wGaBnkB
  1144.  
  1145.    mgX/AfQBvAEHAu8B9wHxB/8MUUL/AUIBTQE+BwABPgMAASgDAAFAAwABIAMAAQEBAAEBBgABARYA
  1146.  
  1147.    A///AAIACw=='))
  1148.  
  1149.         #endregion
  1150.  
  1151.         $imagelist1.ImageStream = $Formatter_binaryFomatter.Deserialize($System_IO_MemoryStream)
  1152.  
  1153.         $Formatter_binaryFomatter = $null
  1154.  
  1155.         $System_IO_MemoryStream = $null
  1156.  
  1157.         $imagelist1.TransparentColor = 'Transparent'
  1158.  
  1159.         #
  1160.  
  1161.         # ErrorProviderOU
  1162.  
  1163.         #
  1164.  
  1165.         $ErrorProviderOU.ContainerControl = $formChooseOU
  1166.  
  1167.         #endregion Generated Form Code
  1168.  
  1169.        
  1170.  
  1171.         #----------------------------------------------
  1172.  
  1173.        
  1174.  
  1175.         #Save the initial state of the form
  1176.  
  1177.         $InitialFormWindowState = $formChooseOU.WindowState
  1178.  
  1179.         #Init the OnLoad event to correct the initial state of the form
  1180.  
  1181.         $formChooseOU.add_Load($Form_StateCorrection_Load)
  1182.  
  1183.         #Clean up the control events
  1184.  
  1185.         $formChooseOU.add_FormClosed($Form_Cleanup_FormClosed)
  1186.  
  1187.         #Show the Form
  1188.  
  1189.         return $formChooseOU.ShowDialog()
  1190.  
  1191.        
  1192.  
  1193.     } #End Function
  1194.  
  1195.    
  1196.  
  1197.     #Call OnApplicationLoad to initialize
  1198.  
  1199.     if ((OnApplicationLoad) -eq $true)
  1200.  
  1201.     {
  1202.  
  1203.         #Call the form
  1204.  
  1205.         Call-AD_OU_select_pff | Out-Null
  1206.  
  1207.        
  1208.  
  1209.         #Perform cleanup
  1210.  
  1211.         OnApplicationExit
  1212.  
  1213.        
  1214.  
  1215.         #Output
  1216.  
  1217.         $objSelectedOU
  1218.  
  1219.     }
  1220.  
  1221. }

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/

jvierra
Posts: 13992
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.
  1. $FormEvent_Load={
  2.  
  3.  
  4.  
  5.     $rootCN=[adsi]''
  6.  
  7.     $nodeName=$rootCN.Name
  8.  
  9.     $key="LDAP://$($rootCN.DistinguishedName)"
  10.  
  11.     $treeview1.Nodes.Add($key,$nodeName)   
  12.  
  13. }
  14.  
  15.  
  16.  
  17.  
  18.  
  19. $treeview1_NodeMouseClick=[System.Windows.Forms.TreeNodeMouseClickEventHandler]{
  20.  
  21.     if (-not $_.Node.IsExpanded) {
  22.  
  23.         $thisOU = [adsi]$_.Node.Name
  24.  
  25.         $nodename.Text = $thisOU.Name
  26.  
  27.         $listbox1.DataSource = [collections.arraylist]@($thisOU.Children)
  28.  
  29.         if (-not $_.Node.Nodes) {
  30.  
  31.             $nodepath.Text = $thisOU.DistinguishedName
  32.  
  33.             $searcher = [adsisearcher]'objectClass=organizationalunit'
  34.  
  35.             $searcher.SearchRoot = $_.Node.Name
  36.  
  37.             $searcher.SearchScope = 'OneLevel'
  38.  
  39.             $searcher.PropertiesToLoad.Add('name')
  40.  
  41.             $OUs = $searcher.Findall()
  42.  
  43.             foreach ($ou in $OUs) {
  44.  
  45.                 $_.Node.Nodes.Add($ou.Path, $ou.Properties['name'])
  46.  
  47.             }
  48.  
  49.         }
  50.  
  51.         $_.Node.Expand()
  52.  
  53.     } else {
  54.  
  55.         $_.Node.Collapse()
  56.  
  57.     }
  58.  
  59. }
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 245 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

jvierra
Posts: 13992
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 223 times

Locked