IIS Server Security - Enumerating Groups in ASP with IIS 6.0

This is Interesting: Free IT Magazines  
Home > Archive > IIS Server Security > October 2004 > Enumerating Groups in ASP with IIS 6.0





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Enumerating Groups in ASP with IIS 6.0
kmarks

2004-10-28, 5:51 pm

I am having an issue enumerating a given users groups with the following ASP
script:
Sub GetGroups()
Dim sDomain
sDomain = "bsd-dean"
UserGroups = ""
if instr(1,Request.ServerVariables("LOGON_USER"),"\") > 0 then
sUser = replace(Request.ServerVariables("LOGON_USER"),"\","/")
else
sUser = sDomain & "/" & Request.ServerVariables("LOGON_USER")
end if
Set oUser = GetObject("WinNT://" & sUser)
For Each oGroup In oUser.Groups
if UserGroups <> "" then UserGroups = UserGroups & "," end if
UserGroups = UserGroups & oGroup.Name
Next
Response.Write UserGroups
Response.Write "<br>"
'Response.Write oUser.get("name")

if UserGroups<>"" then UserGroups=split(UserGroups,",")
set oUser = Nothing
set oGroup = Nothing
end sub

The script works fine on my 2000 server machine and also works for the
administrator on the 2003 machine. I get the user logon info including the
domain, but I get an access denied error when it tries to read the groups
that the users are in. Anybody know how to get this to work?


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com