I export all the computer accounts from two different domains with the script below:
CSVDE -d "DC=DC,DC...etc." -s servername -r "(&(objectClass=computer)(!useraccountcontrol:1.2.840.113556.1.4.803:=2))" -f comp.csv -l DN,cn,description,userAccountControl,managedBy
The column order for the first domain is: DN,cn,description,userAccountControl,managedBy
.
If I run the same script for the next one: DN,cn,userAccountControl,description,managedBy
.
How on earth is that possible?
Speed and simplicity: this is expected behaviour. CSVDE returns results in no particular order. You must not assume the order of results see the documentation explanation for the -l option.
See this previous post on this here at SO.