Last post Feb 14, 2006 10:50 AM by patrick24601
Feb 13, 2006 08:22 AM|A_Hammer|LINK
First of all, I've looked through the previous pages and found two or three questions that deal with pretty much exactly what I'm asking here - although none of those posts have been replied to. So I'll try too.
I'm developing a web application in C# where a user can search for global contacts (the one you see under Global Contacts in Outlook when connected to the exch.server) on the Exchange server in the same network where the web page is running. I've been studying
LDAP for only about a day, so I may have gotten a few of the basic concepts wrong. According to my boss, the Exchange server in our office is open (i.e. no authentication should be needed, which I think sounds a little strange).
My search function so far looks something like this:
DirectoryEntry DirEnt =
DirectorySearcher DirSrc = new DirectorySearcher(DirEnt);
DirSrc.Filter = "(& (mailnickname=*)(objectClass=user))";
DirSrc.SearchScope = SearchScope.Subtree;
SearchResultCollection ResultCol = DirSrc.FindAll();
I think it's obvious what I'm trying to do here - just list all users that have a mail nick name, which should be everyone in the global list. Maybe I've got something wrong with the search details (but all tutorials say almost
the same thing), but the application throws an exception when I try: DirSrc.FindAll();
It says: An operations error occurred at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at ... So I don't really know if my filters and stuff are correct, since it won't even connect properly
to the server.
I get a different message when I type the wrong server name, so at least the server is found. The standard port for LDAP (389) is open as well (I've tried to Telnet to it).
Maybe the only error is that I need an admin user name/password?
Any help appreciated.
Feb 14, 2006 10:18 AM|dunnry|LINK
Feb 14, 2006 10:50 AM|patrick24601|LINK
Hammer - Listen to this Ryan guy. He knows his stuff. He OWNS this forum :-)