Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine if visitor belongs to an NT group

Status
Not open for further replies.

MikeT

IS-IT--Management
Feb 1, 2001
376
US
I have an ASP page on my intranet that regular users use, as well as users who belong to a special group. I need the page to deterimine if the vistior belongs to this special group. Can VBScript/ASP do this?

Thanks
 
Yes it can be done. The complexity depends on how you obtain the user's login.

If you allow the user to input it - no biggie, you use that to validate against the group.

If you want the app. to detect the user, then you're not going to be able to use anonymous access as your authentication method. I believe their's a FAQ or at least a thread in the ASP forum that discusses how to determine the user's login name with Basic authentication.

AFA validating against the group, you'll use ADSI - of which you can find plenty of example scripts in the MSDN. Jon Hawkins
 
Isn't ADSI for Windows 2000 servers? I'm using NT4.
 
The webserver can have any Win. OS. If it's not 2K or later, you can install the ADSI client accordingly. By default, I believe the other OS's only provide partial support for ADSI.
If you're PDC is not Win 2K w/ Active directory implemented, I believe you can still use the WinNT DS provider (assuming your PDC is NT4 Server). I dont currently have access to a NT4 domain or else I would test this, sorry.

Goto your webserver and paste this into a .vbs file, replace the domain, user & group names with valid names on your network and execute it.

Set oDomain = GetObject("WinNT://MyDomain")
Set oUser = oDomain.GetObject("User","MyUser")
Set oGroup = oDomain.GetObject("Group", "MyGroup")
WScript.Echo oGroup.IsMember(oUser.AdsPath) Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top