I currently have a script that pulls a list of OUs into an ADODB RecordSet. In the query I pull the DN and canonicalName of the OU. I then take the canonicalName of the OU and sort the list using a bubble sort function.
I've got approximately 180 OUs and I've found that this process isn't very efficient, especially since bubble sorts don't scale well beyond about 100 elements.
What I'm looking for is a way to sort the results directly in ADODB. Unfortunately, the canonicalName attribute is returned from AD as a multi-value string, and this type of data cannot be sorted using the oRecordSet.Sort property.
Is there a way of sorting data from the right instead of from the left? Then I can use the DN field to sort on.
The reason that I'm using canonicalName is because it is easy to read...
i.e.
domian.tld
domian.tld/RootOU
domian.tld/RootOU/ParentOU
domian.tld/RootOU/ParentOU/SubOU
Ideas?
PSC
Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
I've got approximately 180 OUs and I've found that this process isn't very efficient, especially since bubble sorts don't scale well beyond about 100 elements.
What I'm looking for is a way to sort the results directly in ADODB. Unfortunately, the canonicalName attribute is returned from AD as a multi-value string, and this type of data cannot be sorted using the oRecordSet.Sort property.
Is there a way of sorting data from the right instead of from the left? Then I can use the DN field to sort on.
The reason that I'm using canonicalName is because it is easy to read...
i.e.
domian.tld
domian.tld/RootOU
domian.tld/RootOU/ParentOU
domian.tld/RootOU/ParentOU/SubOU
Ideas?
PSC
Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers