Active Directory and getobject("WinNT://"

J

Jeff

All,

I have a simple ASP web application that has been working great for
years, and now we are moving to Active Directory. The following code
is in my global.asa file, but is not working anymore. Note, although
we have upgraded to AD, the usernames have stayed the same.

Sub Session_OnStart
'**Session on Start code here **
strUsername=Replace(ucase(Request.ServerVariables("LOGON_USER")) ,
"\", "/")
set adsUser = getobject("WinNT://" & strUsername)
for each group in adsUser.groups
GrpList = GrpList & ucase(trim(group.name)) & ";"
next
if instr(GrpList ,"MYGROUP") then
Session("ok") = "OK"
else
Response.Redirect "notauthorized.htm"
end if
End Sub

Any help would be greatly appreciated!

Jeff
 
R

Ray Costanzo [MVP]

What does "not working" mean? Do you get an error? If so, what does it
say?

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top