79522397

Date: 2025-03-20 09:09:25
Score: 0.5
Natty:
Report link

veefu's answer did not work for my case, but it was the right hint.

Here real-world example, needed to easy-compare several AD objects easier in a spreadsheet later:

$User = Get-ADObject -Identity "CN=User,OU=Users,OU=Company,DC=Company,DC=local" -Properties *
$User.psobject.Properties |
    Select-Object @{name='Name';expression={$_.Name}},
                  @{name='Value';expression={$_.Value}} |
    Export-Csv -Path User.csv -Encoding UTF8

Depending on your preference and region you might want to add -NoTypeInformation and/or -Delimiter ";".

Reasons:
  • Blacklisted phrase (1): did not work
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Joachim Otahal