Microsoft.ActiveDirectory.Management.ADPropertyValueCollection issue on get-aduser

We are trying to run:

get-aduser username -Properties * | select name, publicDelegates, publicDelegatesBL

But the output only returns Microsoft.ActiveDirectory.Management.ADPropertyValueCollection, despite knowing there are delegates setup.
Is there anyway round this? I dont understand why it doesnt return the correct information. I did wonder if its perhaps because there are a number of entries in both fields?
LVL 4
pma111Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

footechCommented:
I'm guessing you're getting that when running
get-aduser username -Properties * | select name, publicDelegates, publicDelegatesBL | Export-CSV file.csv

Open in new window

but not when you don't export to a .CSV (i.e. output to console).  If so, then yes, it's because the propery contains a collection.  When exporting, each property can only contain a string, otherwise it won't show the contents.  The usual fix is to create a calculated property, the value of which is all the values within the desired property joined together to form a single string.

Here's an example of a calculated property that you can use with Select-Object.
@{n="publicDelgates";e={$_.publicDelegates -join ";"}}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Raymond PengSystems EngineerCommented:
When you run the command get-aduser username -Properties *
Do you see the property in there?

I know some properties won't show if they have empty values

what happens when you pipe get-aduser username -properties * | get-member
pma111Author Commented:
footech, no we didnt add the export to csv command
footechCommented:
Can you post a screenshot of the console after you've run the command?
pma111Author Commented:
footech sorry my mistake it was an issue when using the export-csv command, the results did show up in console, or if blank showed as

{ }

Many Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.