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 }
gregm
Windows Server > Windows PowerShell
Comments
Post a Comment