473,226 Members | 1,683 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,226 software developers and data experts.

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 12859
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jon Rista | last post by:
Hello. I'm trying to automate Excel in a C# Windows Service. This windows service has to be able to access files on network shares, so it uses a domain account on a WinNT 4.0 domain server, rather...
4
by: Carlitos | last post by:
Hi there, I got a web application in vb.net that uploads a .zip file to a subfolder inside the root folder of the web application. c:\Inetpub\wwwroot\MyWebApp\uploaddir Then, a c# library...
2
by: Craig Santoli | last post by:
"... to ASPNet as attempted from C:\WINNT\System32\WBEM\WinMgmt.exe." This error keeps appearing in the Windows 2000 Server Event Viewer. Any ideas on what's causing this or how to prevent it?...
6
by: ASP.Confused | last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses this, and I wanted to be compatible with them.) I...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
2
by: Loane Sharp | last post by:
Hi there I'm using VB.NET and Office Web Components to access a SQL Server 2005 Express database and draw pictures on the fly in my ASP.NET application. Using .ExportPicture to write the...
0
by: lpinho | last post by:
Hi There, I've generated a C# file from a wsdl file using wsdl.exe utility. Then I created a console application and made a call to the method generated, first I got the error: "The request...
1
by: Jeff | last post by:
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...
1
by: Ron | last post by:
Hi there, We have a web application written in C# that need to deal with MS word 2003. it works fine on developer's machine but when I deployed it on web server, we got error msg says "Access is...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.