Tip: You are logged in domain1 and you want to search a user located in domain2.
1 2 3 4 5 |
# Domain name Get-ADUser -Server 'domain2.com' -Filter { SamAccountName -eq 'sPowershell' } # Directory server Get-ADUser -Server 'dc.domain2.com' -Filter { SamAccountName -eq 'sPowershell' } |
Note: Get-ADUSer requires ActiveDirectory module.
Pingback: Powershell Tip #78: Find the Windows installation date | Powershell Guru
Pingback: Powershell Tip #80: Find MAC address on a remote computer | Powershell Guru