I am facing the problem, that the csvde.exe
export from an ActiveDirectory
changes the order of the columns. I am aware of the following line in the CSVDE
documentation:
LDAP can return attributes in any order, and csvde does not attempt to impose any order on the columns.
I also saw this question. However I was wondering why LDAP
is returning different orders on different pcs or even on different queries
. Let me show you an example:
These are the two commands
:
csvde -u -f userdata_it.csv -d "ou=it,dc=your-company,dc=org" -l objectClass,SamAccountName,CN,Distinguishname,memberOf
csvde -u -f userdata_entwicklung.csv -d "ou=entwicklung,dc=your-company,dc=org" -l objectClass,SamAccountName,CN,Distinguishname,memberOf
The are exactly the same, expect for the organisational unit
. But I have a pc
, that will get the csv
column order for the first query
: objectClass,SamAccountName,CN,Distinguishname,memberOf
And for the second query
:
objectClass,SamAccountName,CN,memberOf,Distinguishname
I was wondering why this is happening? Because on another pc
this works like expected. Are there any known solutions? Maybe another program than csvde
?
The results of an LDAP search is not repeatable, that is, the ordering is not repeatable, or predictable. LDAP clients must not assume ordering of the entries, attributes, or attribute options in an LDAP search result.
see also