PowerShell – Search any User on Active Directory
Below is a small PowerShell script that allows you to search any user on Active Directory:
$user = Read-Host "Enter the name of the user"
Get-ADUser -Filter "sAMAccountName -like ‘*$user*’" |
Get-ADObject -Properties * | ft Name,SamAccountName,Title,,UserPrincipalName,Department