$strFilter = "(&(objectCategory=Computer)(Name=FBX*))"
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1000
$objSearcher.Filter = $strFilter
$objSearcher.SearchScope = "Subtree"
$colProplist = "name"
foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)}
$colResults = $objSearcher.FindAll()|Export-Csv -NoTypeInformation "C:\Documents and Settings\tlafferty\Desktop\comps.csv"
#foreach ($objResult in $colResults)
# {$objItem = $objResult.Properties; $objItem.name}
cls;Write-Host "Finished..."
|