Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Exporting department number attribute to excel using the export-csv not as expected

$
0
0

Hi forum,

Sorry for the real newbie question!
I have just started down the learning path of powershell and I am having I little difficulty with the command below. 
Get-ADUser -Filter * -SearchBase "cn=someOu,cn=anotherOU,dc=domain,dc=local" | select 'samAccountName','GivenName','SurName','DepartmentNumber' | export-csv .userexport.csv

When exported to excel the last value departmentnumber is not displayed, I have discovered that this attribute is a multi value attribute but I am at a loss of how to go about retreiving the value. I have seen the in other posts how it is done for memberOf but this does not work when I add it to the command. Any hints or tips would be greatly appreciated

Viewing all articles
Browse latest Browse all 6937

Trending Articles