I am using the directorysearcher to retrieve the value of a custom AD attribute.
I am at a loss to explain this behaviour when I try to retrieve it.
I first run this code:
$searcher = New-Object DirectoryServices.DirectorySearcher $searcher.Filter = "(&(name=Computer1)(objectClass=computer))" $searcher.pageSize = 1000 $ADSearchResults = $searcher.FindAll()
I then try to display the custom attribute by running this command:
...and nothing is displayed.
If I type this:
...then the value is returned - however if I type this:
...all the properties are returned - now here's the thing - if I now type this:
It returns a value where it didnt when I first typed it after the findall command.
Why is this happening?