Active Directory question

Hello!

I'm trying to log in users on a intranet site by using our active directory. I created three groups with a simple boolean check to see if that user is part of that group. But it's not looking at the active directory at all, because it doesn't return a true or false value.

Here is some code.

If Request.IsAuthenticatedThen

Label1.Text = User.Identity.Name

''' Label2.Text = User.IsInRole("DocAccel Admins")

Label2.Text = User.IsInRole("DocAccel Nurses")

'Label2.Text = User.IsInRole("Administrators")

EndIf

If Label2.Text = ("False")Then

Response.Redirect("NoAccess.aspx")

It's pretty simple. I know the User.IsInRole works, because I have tried on a diffrent AD. The problem I have with the AD I'm working with has sevral OU's. Up to five levels.

Any thought how I can get to a group that is that deep into the AD? Or should this work?

Thanks!

Rudy

[1707 byte] By [Rudemusik] at [2008-1-7]
# 1

Ok, first, this appears to be an ASP.Net question. These forums are for Windows Forms (desktop) applications. For ASP.Net projects, please use the dedicated ASP site at http://forums.asp.net.

To answer your question, the User.IsInRole method is looking at the Roles defined in the web application. If you launch the ASP site adminsitration webpage from the designer you'll see where you can set roles for your web application. These roles are not tied to Active Directory.

It is possible to query active directory instead of the web application role manager, but as stated, you'll need to use the asp.net website to find your answer.

Good luck!

rkimble at 2007-10-2 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

Of course. My mistake. So tired last night when I wrote this, didn't even pay attention. I'll pass it on to them.

Thanks!

Rudy

Rudemusik at 2007-10-2 > top of Msdn Tech,Visual Basic,Visual Basic General...