. {
$Domainmachines = (([adsi]"WinNT://$((Get-WMIObject Win32_ComputerSystem).Domain)").Children) | Where {$_.schemaclassname -eq 'computer'}
Foreach( $machine in $Domainmachines) {
Select-Object -ExpandProperty Name -InputObject $machine
}
} 2>$null