How can I retrieve a specific property exclusively?
I am aware of the select-object
cmdlet which seems to be dowdy in that respect:
PS C:\> Get-ADOrganizationalUnit -SearchBase 'OU=Houston,DC=contoso,DC=net' -Filter 'Name -like "SomeOU"' -Properties * | Select-Object Description,Streetaddress,State,postalcode | format-list
An optimized version would be:
PS C:\> Get-ADOrganizationalUnit -SearchBase 'OU=Houston,DC=contoso,DC=net' -Filter 'Name -like "SomeOU"' -Properties Description,Streetaddress,State,postalcode
Why is the -property
switch not solely returning the entered propteries?