Code: Select all
$label2.Text = Get-ADUser -Filter "EmployeeID -eq '<emp id number>'" -Properties Name, SAMAccountName, Enabled, description, title, SID, UserPrincipalName | Format-List -Property Name, SAMAccountName, Enabled, Description, Title, UserPrincipalName, SID | Out-String
I adjusted the script for this form, you would normally enter emp # in text box then click find. Clicking find does the magic and runs the script to populate the label2 textbox.
Sadly it took 20mins to build form and do the scripting, about over an hour of trying to tinker with the format-list part and end result before creating this form. I know it will take 2 mins for someone to assist me,