I currently have a secure section oJohn Doef my intranet, protected by an Active Directory Security Group, that I only want a select few users to even know it exists (the members of that group). One way I've been keeping others out is a little bit of script at the beginning of the file that redirects the user away if their name isn't found in a hard-coded list compared against the current REMOTE_USER Server Variable.
I'd like to integrate this with Active Directory so I don't have to keep going back to that hard-coded list to add/delete users as the list of admins changes.
I have found some GREAT resources on the web as well as Tek-tip posts that led me to trying to query Active Directory to check for group membership, but I'm still stuck.
Here's my bottleneck:
The only input I have is the windows logon ID from the REMOTE_USER Server Variable (say in this case, the person's name is John Doe and our company standardizes with lastnameFirstInitial as the user name convention: [blue]doej[/blue]).
The following Code accesses Active Directory and looks up the user:
I'm stuck at how I can use [blue]doej[/blue] which I got from the Request.ServerVariables command. I never ask for a user's first and last name (and I don't want to depend on them to spell it right), and when I try to use [blue]doej[/blue] instead of the full name (John Doe), I get an error.
Does anybody have more experience in accessing Active Directory via ASP who can help me out here?
Here are some resources I've used to get me where I am now... Look here first, and if you think you need to see my code, I can copy paste that later. (just wanted to keep the post lenght down...)
thread333-532861
Earnie Eng
I'd like to integrate this with Active Directory so I don't have to keep going back to that hard-coded list to add/delete users as the list of admins changes.
I have found some GREAT resources on the web as well as Tek-tip posts that led me to trying to query Active Directory to check for group membership, but I'm still stuck.
Here's my bottleneck:
The only input I have is the windows logon ID from the REMOTE_USER Server Variable (say in this case, the person's name is John Doe and our company standardizes with lastnameFirstInitial as the user name convention: [blue]doej[/blue]).
The following Code accesses Active Directory and looks up the user:
Code:
Set objADUser = GetObject("LDAP://CN=John Doe,CN=Users,DC=MyDomain,DC=com")
I'm stuck at how I can use [blue]doej[/blue] which I got from the Request.ServerVariables command. I never ask for a user's first and last name (and I don't want to depend on them to spell it right), and when I try to use [blue]doej[/blue] instead of the full name (John Doe), I get an error.
Does anybody have more experience in accessing Active Directory via ASP who can help me out here?
Here are some resources I've used to get me where I am now... Look here first, and if you think you need to see my code, I can copy paste that later. (just wanted to keep the post lenght down...)
thread333-532861
Earnie Eng