by Beefstew at 2013-02-15 07:05:10
Hi,by ArtB0514 at 2013-02-15 07:36:04
Could anyone tell me why this most basic scipt is only returning the "name" value and not the "proxyaddresses"?
Thanks
$strFilter = "(objectCategory=User)"
$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", "proxyAddresses"
foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)}
$colResults = $objSearcher.FindAll()
foreach ($objResult in $colResults)
{$objItem = $objResult.Properties; $objItem.name}
Wouldn’t it be easier to use the AD cmdlets from RSAT?by Beefstew at 2013-02-15 08:13:53$Proxy = Get-ADUser -Filter * -Properties proxyAddresses | Select Name,proxyAddresses
or the equivalent in the Quest snap-in?$Proxy = Get-QADUser -SizeLimit 0 -IncludedProperties proxyAddresses | Select Name,proxyAddresses
How would I filter on a particlar OU please?by Klaas at 2013-02-15 08:31:45
Cheers
$Proxy = Get-ADUser -SearchBase 'OU=yourOU,DC=yourcompany,DC=com' -Filter * -Properties proxyAddresses | Select Name,proxyAddresses