Why do I see these values when the script runs?


hello,

below subset of code runs in script.  when line {$objsearchqts.propertiestoload.add($i)}
 runs each time in foreach loop, echos '0' first time through, '1'.  regardless if run command line, debugger, etc., see these values.  why , how can suppress display of values? in advance help!

$strfilterqts = "(&(objectcategory=person)(objectclass=user)(whencreated>=20000101000000.0z)(employeeid=$strfiltervar))"

$objqtsdir    = new-object system.directoryservices.directoryentry("ldap://dc=devqtsnet,dc=qts,dc=net ")
$objsearchqts = new-object system.directoryservices.directorysearcher
$objsearchqts.searchroot = $objqtsdir
$objsearchqts.pagesize = 1000
$objsearchqts.filter = $strfilterqts
$objsearchqts.searchscope = "subtree"
#------------------------------------------------------------------------------------------------
# search 'cn' , 'employeeid' attributes
#------------------------------------------------------------------------------------------------
$colproplistqts = "cn", "employeeid"
foreach ($i in $colproplistqts)
        {$objsearchqts.propertiestoload.add($i)}
$colresultsqts = $objsearchqts.findall()


mtv99

  try  
  foreach ($i in $colproplistqts)  {   $objsearchqts.propertiestoload.add($i) | out-null  }    
suspect propertiestoload.add function returned true or false.
gregm


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

2008 Windows Deployment Server Properties Error

Can no longer user MS Update - Files required to use Microsoft Update are no longer registered

How do a find data in one file, search for it in another file and if not found, write a custom message to another file