473,320 Members | 1,974 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.

Access denied while trying to change password in Active Directory

Hi. I have some code that updates a user's account properties in Active
Directory. The code also has a call that resets the account password (see
code below). I put the code in a .dll and have a test vb.net app that calls
it. It works fine from there. When I try to call the .dll from an asp.net
app, the update works but I get the error 'Access is Denied' when I try to
reset the password. Anyone have any ideas?

Maybe you need to be a domain member to reset passwords but not to update
accounts and the asp.net app which calls the .dll runs under the aspnet
account which might not be a memeber of the AD domain I'm working in. Just a
guess.

myNewDirectoryEntry = mySearchResult.GetDirectoryEntry()
With myNewDirectoryEntry
.Invoke("SetPassword", myPassword)
.CommitChanges()
End With
Jul 21 '05 #1
3 9127
On Fri, 7 Jan 2005 05:37:05 -0800, "CLEAR-RCIC" <CL*******@discussions.microsoft.com> wrote:

¤ Hi. I have some code that updates a user's account properties in Active
¤ Directory. The code also has a call that resets the account password (see
¤ code below). I put the code in a .dll and have a test vb.net app that calls
¤ it. It works fine from there. When I try to call the .dll from an asp.net
¤ app, the update works but I get the error 'Access is Denied' when I try to
¤ reset the password. Anyone have any ideas?
¤
¤ Maybe you need to be a domain member to reset passwords but not to update
¤ accounts and the asp.net app which calls the .dll runs under the aspnet
¤ account which might not be a memeber of the AD domain I'm working in. Just a
¤ guess.
¤
¤ myNewDirectoryEntry = mySearchResult.GetDirectoryEntry()
¤ With myNewDirectoryEntry
¤ .Invoke("SetPassword", myPassword)
¤ .CommitChanges()
¤ End With

What type of authentication are you using for your web application and are you using impersonation?

I'm assuming that the account you are trying to use has sufficient privileges to set a password.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #2
I'm using annonymous authentication on the website and I am not using
impersonation. Should I be? I specify an account while creating the
Directory Entry object. The account is a member of the Account Operator
group. As I said, the .dll works fine when being called from a vb.net app.

"Paul Clement" wrote:
On Fri, 7 Jan 2005 05:37:05 -0800, "CLEAR-RCIC" <CL*******@discussions.microsoft.com> wrote:

¤ Hi. I have some code that updates a user's account properties in Active
¤ Directory. The code also has a call that resets the account password (see
¤ code below). I put the code in a .dll and have a test vb.net app that calls
¤ it. It works fine from there. When I try to call the .dll from an asp.net
¤ app, the update works but I get the error 'Access is Denied' when I try to
¤ reset the password. Anyone have any ideas?
¤
¤ Maybe you need to be a domain member to reset passwords but not to update
¤ accounts and the asp.net app which calls the .dll runs under the aspnet
¤ account which might not be a memeber of the AD domain I'm working in. Just a
¤ guess.
¤
¤ myNewDirectoryEntry = mySearchResult.GetDirectoryEntry()
¤ With myNewDirectoryEntry
¤ .Invoke("SetPassword", myPassword)
¤ .CommitChanges()
¤ End With

What type of authentication are you using for your web application and are you using impersonation?

I'm assuming that the account you are trying to use has sufficient privileges to set a password.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)

Jul 21 '05 #3
On Mon, 10 Jan 2005 04:31:04 -0800, "CLEAR-RCIC" <CL*******@discussions.microsoft.com> wrote:

¤ I'm using annonymous authentication on the website and I am not using
¤ impersonation. Should I be? I specify an account while creating the
¤ Directory Entry object. The account is a member of the Account Operator
¤ group. As I said, the .dll works fine when being called from a vb.net app.
¤

If you're using anonymous authentication w/o impersonation then the identify under which your web
application is running is ASPNET. This account, by default, would not have sufficient permissions to
set a user password.

If you're logged on to the network from your desktop with an account that has sufficient permissions
to perform this operation, then use Integrated Windows authentication for your ASP.NET application
with impersonation enabled.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #4

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

Similar topics

3
by: red | last post by:
I know this is probably a faq but it is hard to search for this exact problem. When I put this on a php page: <? $link = mysql_connect("localhost", "cardini", "password") or die("Could not...
0
by: Ryan Schefke | last post by:
------=_NextPart_000_0077_01C34C8B.2B90C960 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ..I just sent this out to the win32 distribution list but no one has...
8
by: John | last post by:
Hello. I am currently working through a book on Dreamweaver and using PHP. I am having a little trouble with setting up the database though. I have php 4.2.3 and MySQL 4.0.20a. I am running...
3
by: Eric Sabine | last post by:
In my web site, I have some features that require NT permissions. For example, one action the user will take uses HTMLInputFile to save a file to another server, another action will do an Active...
5
by: Dave Kolb | last post by:
Is there any other solution for an ASPNET application to access network resources other than running as SYSTEM, using delegation (a nightmare to get to work) or the COM+ solution? I cannot seem to...
12
by: Ron Weldy | last post by:
I have a test server runinng 2003/IIS 6 with a mixture of asp and asp.net files. On my workstation I have a share set up to the folder where the web files reside. I am just doing quick and dirty...
3
by: CLEAR-RCIC | last post by:
Hi. I have some code that updates a user's account properties in Active Directory. The code also has a call that resets the account password (see code below). I put the code in a .dll and have a...
3
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
3
by: Xnet | last post by:
I need to change password of a local user of a W2003, without Active Directory. I need to do it from an application created with VB2005. Thanks!
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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....

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.