469,303 Members | 2,106 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,303 developers. It's quick & easy.

Access denied error using GetObject("WinNT://"

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
Select Case Group.Nam
Case "Domain Admins
Session("Admin")=Tru
Case "Domain Users
Session("User")=Tru
End Selec
Nex

The code works fine on IIS5 and Windows 2000. I have set up a test server with Windows 2003 and IIS6 and created the same application, however the second line of this code returns an error message

Active Directory Error '80070005
General access denied erro

It's obvioulsy a permission issue but I cannot figure out how to get around it. Any help would be greatly appreciated

Thank
Haka
Jul 19 '05 #1
8 12428
most likely the user that IIS is running under doesn't have these
permissions.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Hakan" <an*******@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
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.Groups
Select Case Group.Name
Case "Domain Admins"
Session("Admin")=True
Case "Domain Users"
Session("User")=True
End Select
Next

The code works fine on IIS5 and Windows 2000. I have set up a test server with Windows 2003 and IIS6 and created the same application, however the
second line of this code returns an error message:
Active Directory Error '80070005'
General access denied error

It's obvioulsy a permission issue but I cannot figure out how to get around it. Any help would be greatly appreciated.
Thanks
Hakan

Jul 19 '05 #2
It runs under the Local System account, which is the same as the IIS5 on the live Windows 2000 server.
Jul 19 '05 #3
that's the user specified in the IIS manager as the anonymous account?
Just for a test, try specifying an admin user once, just to test.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Hakan" <an*******@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
It runs under the Local System account, which is the same as the IIS5 on

the live Windows 2000 server.
Jul 19 '05 #4
"Hakan" <an*******@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
It runs under the Local System account, which is the same as the IIS5 on

the live Windows 2000 server.

Hi Hakan,

That is impossible. INETINFO.exe might run under localsystem, but it does
not use localsystem to run anonymous users. Most likely IUSR_computer user
will be used for anonymous pages.

Regards,

Egbert Nierop

Jul 19 '05 #5
Sorry Curt, I misunderstood you. The account is IUSR_computer and I tried the domain administrator account with no success. However, if I add the site to the Local Intranet Zone under security option of IE, the code works on the server (Domain\Administrator account). If I do the same thing on my own PC it still doesn't work, though I am a member of the Domain Admins group. Does this shed any light on the issue

----- Curt_C [MVP] wrote: ----

that's the user specified in the IIS manager as the anonymous account
Just for a test, try specifying an admin user once, just to test

--
Curt Christianso
Owner/Lead Developer, DF-Softwar
www.Darkfalz.co
"Hakan" <an*******@discussions.microsoft.com> wrote in messag
news:77**********************************@microsof t.com..
It runs under the Local System account, which is the same as the IIS5 o

the live Windows 2000 server

Jul 19 '05 #6
Sorry, I misunderstood Curt. The account is IUSR_computer and I tried the domain administrator account with no success. However, if I add the site to the Local Intranet Zone under security option of IE, the code works on the server (Domain\Administrator account). If I do the same thing on my own PC it still doesn't work, though I am a member of the Domain Admins group. Does this shed any light on the issue
----- Egbert Nierop (MVP for IIS) wrote: ----

"Hakan" <an*******@discussions.microsoft.com> wrote in messag
news:77**********************************@microsof t.com..
It runs under the Local System account, which is the same as the IIS5 o

the live Windows 2000 server

Hi Hakan

That is impossible. INETINFO.exe might run under localsystem, but it doe
not use localsystem to run anonymous users. Most likely IUSR_computer use
will be used for anonymous pages

Regards

Egbert Niero
Jul 19 '05 #7
Also, if I try to logon from a pc that's not on the domain network (XP Home) and provide DOMAIN\Administrator user name and password through logon dialogue box, it doesn't work.
Jul 19 '05 #8
Also, if I try to logon from a pc that's not on the domain network (XP Home) and provide DOMAIN\Administrator user name and password through logon dialogue box, it doesn't work.
Jul 19 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Craig Santoli | last post: by
6 posts views Thread by ASP.Confused | last post: by
reply views Thread by ASP.Confused | last post: by
2 posts views Thread by Loane Sharp | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.