Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Active Directory and getobject("WinNT://"

Reply
Thread Tools

Active Directory and getobject("WinNT://"

 
 
Jeff
Guest
Posts: n/a
 
      02-03-2006
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

 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      02-03-2006
What does "not working" mean? Do you get an error? If so, what does it
say?

Ray at work

"Jeff" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASA 5520 Active/Active Conguration Example UBEST Cisco 5 03-24-2008 05:13 PM
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory Nathan Sokalski ASP .Net 2 09-06-2007 03:58 PM
Rolling upgrade of Active-active cluster for SQL server 2000 =?Utf-8?B?U3VzaGls?= MCSE 1 02-16-2006 05:57 AM
Thunderbird filters "active" but not "active" =?ISO-8859-2?Q?Rafa=B3_=A3o=BFy=F1ski?= Firefox 5 05-18-2005 07:27 AM
Active Directory Search fails ("The directory service is unavailab ejcosta ASP .Net Security 2 10-08-2004 09:57 AM



Advertisments