Sample script that searches Active Directory for all the printers with more than 32 megabytes of installed memory. The printMemory attribute is not replicated to the Global Catalog, meaning you cannot connect to a Global Catalog server and search across the forest for printers with a specified amount of installed memory.

PowerShell
Edit|Remove
$strFilter = "(&(objectCategory=printQueue)(printMemory>=32768))"

$objDomain = New-Object System.DirectoryServices.DirectoryEntry

$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1000
$objSearcher.Filter = $strFilter

$colProplist = "name"
foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)}

$colResults = $objSearcher.FindAll()

foreach ($objResult in $colResults)
    {$objItem = $objResult.Properties; $objItem.name}