Here is another quick helper for Help Desk guys to pull quickly information about user in PowerShell:
- SamAccountName
- Title
- Department
- Manager
In this case the manager will be show as FirstName and LastName instead of the Distinguished Name and output is formatted to list output.
Clear-Host
Import-Module ActiveDirectory
$user = Read-Host "[ Enter User.Name ]"
Clear-Host
Write-Host [ Manager Report ] -Foregroundcolor white -BackgroundColor red
Get-ADUser -identity $user -Properties * |
Select-Object -Property SamAccountName,Title, Department, @{label='Manager';expression={$_.manager -replace '^CN=|,.*$'}} |format-list
Import-Module ActiveDirectory
$user = Read-Host "[ Enter User.Name ]"
Clear-Host
Write-Host [ Manager Report ] -Foregroundcolor white -BackgroundColor red
Get-ADUser -identity $user -Properties * |
Select-Object -Property SamAccountName,Title, Department, @{label='Manager';expression={$_.manager -replace '^CN=|,.*$'}} |format-list
Enjoy!