$listbox3.Items.Clear();
$here3 = Get-ADUser -SearchBase "OU=Staff,OU=Amigos,dc=homelab,dc=com" -Filter * | Get-ADUser -Property DisplayName, title | Select -expandproperty Name
$here3 = $here3 | sort-object
load-listbox -Listbox $listbox3 -Items $here3
ASKER
ASKER
Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.
TRUSTED BY
And there's no need to stress AD by calling Get-ADUser twice.
Open in new window
When used with -PassThru, it can even be used to let a user select one (-OutputMode Single) or multiple (-OutputMode Multiple) items from the list.