473,785 Members | 2,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.

myNewDirectoryE ntry = mySearchResult. GetDirectoryEnt ry()
With myNewDirectoryE ntry
.Invoke("SetPas sword", myPassword)
.CommitChanges( )
End With
Jul 21 '05 #1
3 9199
On Fri, 7 Jan 2005 05:37:05 -0800, "CLEAR-RCIC" <CL*******@disc ussions.microso ft.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.
¤
¤ myNewDirectoryE ntry = mySearchResult. GetDirectoryEnt ry()
¤ With myNewDirectoryE ntry
¤ .Invoke("SetPas sword", 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******@amerit ech.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*******@disc ussions.microso ft.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.
¤
¤ myNewDirectoryE ntry = mySearchResult. GetDirectoryEnt ry()
¤ With myNewDirectoryE ntry
¤ .Invoke("SetPas sword", 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******@amerit ech.net
Microsoft MVP (Visual Basic)

Jul 21 '05 #3
On Mon, 10 Jan 2005 04:31:04 -0800, "CLEAR-RCIC" <CL*******@disc ussions.microso ft.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******@amerit ech.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
7096
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 connect : " . mysql_error()); echo "Connected successfully\n"; mysql_select_db("articles") or die("Could not select database");
0
3396
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 replied.can someone on this list please help? The issue should be trivial for experienced MySQL users, I'm just a novice, thanks!
8
18470
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 locally with Apache 1.3.27 on Windows XP Pro. I seem to have finally got MySQL running after a lot of difficulty. In the book it says to type source C:\mysql\newland_tours.sql at the mysql> prompt, to generate the newland_tours database in my...
3
1707
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 Directory query (ADSI). Both of these will require the user to be seen as an NT account, so I created an NT account of which will be able to query active directory because he is a member of it and will be able to save files to that NTFS folder. ...
5
3112
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 impersonate a user and obtain network credentials using the DuplicateTokenEx call with appropriate parameters even though the call seems to not fail. I check my identity has changed but can only still do local commands. I would consider...
12
3099
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 asp editing (like I used to be able to do with 2K/IIS5) where I use VS.NET, open an asp file, make changes, save and refresh my browser. Problem is that I get an Access is Denied error when I try to save the file and then the file gets wiped on...
3
929
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 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...
3
7965
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 C:\Inetpub\wwwroot\RunReportASP is the directory of my virtual directory for my app. In it's properties I did check "Write" as a permission. What else do I need to do?
3
4182
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
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.