I have performed an active directory search and now have a SearchResultCollection of all the users in active directory. I've specified all the properties that the DirectorySearch should load, but I also want to know what OU (distinguished name) each user is in. I know I could figure it out be getting a DirectoryEntry for each user, and look at the distinguished name of the directory entries parent directory entry, but this seems like it would be terribly slow. Is it possible to return the ou distinguished name some other way?
+1
A:
Subtring-after the first comma?
cn=bob, ou=someOU,dc=this,dc=that
would seem to be your goal.
geoffc
2009-09-13 13:03:03
That's what I ended up doing. Thanks.
Jeremy
2009-09-17 17:09:47