0

I ran the below cmdlet with the intent to get all the properties of the AD user.

Get-ADUser -Identity targetuser -Properties *

But I'm only getting fewer properties, not all of them (refer screenshot).

enter image description here

I'm assuming that the remaining properties are present within the 'PropertyNames' field (highlighted in red). When I tried to expand it using the '-ExpandProperty' option, it only gave me the names of those nested properties but not their values.

Please advise how to proceed. My objective is to get all the properties and their values.

  • PowerShell by default only shows a subset of all the properties. If you want to see them all, do `Get-ADUser -Identity targetuser -Properties * | Format-List *` – Theo Feb 10 '22 at 10:46
  • Thanks but the `| Format-List *` option did not help. Infact I tried it already. It gives the exact same result as the above screenshot. Any other recommendations? – NewKidOnTheBlock Feb 10 '22 at 19:19

1 Answers1

0

You are almost there. Use Get-ADUser targetuser -properties * | select * to see all property values.

Dallas
  • 542
  • 1
  • 8
  • 19
  • Thanks but this did not help either. It also gave the exact same result as the above screenshot. – NewKidOnTheBlock Feb 11 '22 at 09:23
  • That's strange. Works for me. – Dallas Feb 11 '22 at 14:29
  • Any other recommendations, anyone? I could really use some guidance. Thanks in advance. – NewKidOnTheBlock Feb 16 '22 at 09:08
  • I know that query, swapping out targetuser with actual user, works for myself and others. Are you sure you included both `-properties *` and `| select *`? Without `-properties *` you would only get the default few properties, but that switch includes them all, and the select let's you grab just the fields you need from what is pulled in, but the properties and values aren't going to be gathered initially without getting them all first. Hope that helps, as the syntax should be correct. If not, I don't think it would matter, but what version of PS are you using? – Dallas Feb 17 '22 at 17:50