27 June 2012

Export Ldap multivalue attributes

When you try to export to a CSV file a multivalue Ldap attribute like "MemberOf" or "ProxyAddresses" you will find in CSV file only a description of your attribute data type:

PS C:\temp> Get-ADUser marius.dumitru -Properties memberof|Export-Csv -NoTyeInformation user_groups.csv



You can use "join" function to export the multivalue attribute:

Select-Object name, @{Name="MemberOf"; Expression={[string]::join(";",($_.MemberOf))}}



No comments:

Post a Comment