473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Active Directory and getobject("WinNT://"

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

Feb 3 '06 #1
1 5360
What does "not working" mean? Do you get an error? If so, what does it
say?

Ray at work

"Jeff" <je***********@tevaneuro.com> wrote in message
news:11**********************@g43g2000cwa.googlegr 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

Feb 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Hakan | last post by:
I use the following code to check if a user is an admin in the login page of our intranet. Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user" For Each Group in User.Group...
4
by: Ed | last post by:
Hello All, I posted earlier about a problem I was having with editing or pasting/deleting files in the "Home Directory" of my web server. I just noticed that the "Home Directory" option in the...
0
by: chaf2701 | last post by:
Hi, I was in trouble with the System.Windows.Forms.ImageList control from VC.NET. I was doing the following : 1. New Project, C#, Windows Application 2. Add ImageList component imageList1 to...
0
by: mammucion | last post by:
Trying to automate processing 80,000 data sets through 15 web pages. Application URL creates a new IE instance in which runs first a login form and then runs the rest of the pages in the new...
0
by: Stick | last post by:
I like the toolStrip control, and would like to know how to find out what Icons are available for: resources.GetObject("tsPanelLight.Image") Where can I find a list of the standard ones...
6
by: active | last post by:
This works with Strict Off But not with Strict On Sometimes I can figure out what is needed by running it and using QuickWatch to see the type required but GetObject("winmgmts:\\" &...
2
by: mirin | last post by:
Hi Folks, I'm using .NET framework 2.0 My code errors out on the below line: objRootDSE = GetObject("LDAP://rootDSE") The error message is "Cannot create ActiveX component". The same...
2
by: ironmanlarry | last post by:
Hi, I'm trying to do a mail merge from Excel to Word (programatically) and I'm having some trouble creating the Word Document Object. This line of code wordDoc = GetObject("sheet.doc") keeps...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.