473,387 Members | 1,420 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,387 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 9138
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.