This simple script allows you to search for computers in a forest that contains several trust domains. If it finds the computer on a domain it will return the details it requests, otherwise it simply indicates that it is not present on the domain. You can modify 

- Get-ADComputer -Identity $pc -server domain01.com | select-object name, DistinguishedName    for add other properties  using 

- Get-ADComputer -Identity $pc -server domain01.com -properties * | select-object name, DistinguishedName, etc, etc, 

.................................................................................................................................................................................................

.................................................................................................................................................................................................

PowerShell
Modifica script|Remove
#find pc multiple domain 
# Daniele Managò - February 2018 
 
import-module activedirectory 
 
$pc = Read-Host "Computer name:" 
 
#domain01 
try { 
Get-ADComputer -Identity $pc -server domain01.com | select-object name, DistinguishedName 
} 
catch [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException] 
{ 
Write-Warning “AD computer object $pc not found on DOMAIN01” 
} 
 
#domain02 
try { 
Get-ADComputer......... 
 
 
the result is  
 
wks02 CN=wks02,OU=Workstation,DC=domain01,DC=com 
WARNING: AD computer object wks02 not found on DOMAIN02 
WARNING: AD computer object wks02 not found on DOMAIN03