Getting Objects Out of AD
This is dsquery.exe computer -name <foo>
function Get-ComputerObjects {
param( [string]$name="*" );
$directorySearcher = new-object DirectoryServices.DirectorySearcher([ADSI]"LDAP://$env:userDnsDomain");
$directorySearcher.PageSize = 1000;
$directorySearcher.Filter = "(&(objectCategory=computer)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(name=$name))";
$directorySearcher.FindAll()
}