Getting Users info from active directory using asp.net

Hi all

I am trying to connect to the active directory and display the user info in a web application. I have given the following code. Error keeps on coming when I run the program.

I need to know,
1. What else is required in the code?
2. If some permission is to be given in IIS?
3. Any other thing which I am missing and is required to apply before runnig the code?

I am getting error at this line:-
foreach(string key in entry.Properties.PropertyNames)

The error is:-
"System.Runtime.InteropServices.COMException: The server is not operational"

Full Code:-
DirectoryEntry entry = new DirectoryEntry("LDAP://10.10.1.33/DC=dmn,DC=in", u_name , pwd);
string account = u_name;
foreach(string key in entry.Properties.PropertyNames)
{
Response.Write("<br>");
foreach(Object objv in entry.Properties[key])
{
Response.Write(objv.ToString());
}
}

Please reply ASAP. i need the soluction very urgently.

Rgds
Deepk Kumar

[1145 byte] By [kumar_deep] at [2007-12-16]
# 1
kumar, can I suggest you ask this question in the ASP.NET forums: http://forums.asp.net

Regards,
Kit

KitG at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified