473,804 Members | 3,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Comexception when setting domain password with directoryentry in a ASP.NET project

Hallo,

I have to change a user password in my ASP.NET project.
In the first step I was trying to change my own passwort (as example) in
Active Directory on my Server, but already at this point I get problems.
Can somebody help me?

1. I use following fragment of code:
-----------------------------------
DirectoryEntry DirEntry;

DirEntry = new DirectoryEntry( @"WinNT://XXX-DOMAIN","MyName ","MyPassword") ;

DirEntry.Invoke ("setPasswor d", "testtest") ;

@"WinNT://XXX-DOMAIN"," is the name of the Server

2. Error
--------------------------------

The line:

DirEntry.Invoke ("setPasswor d", "testtest") ;

fires an error:

System.Runtime. InteropServices .COMException: unknown name.

Can somebody tell me, what I am doing wrong?

Greetings

Marek
Nov 19 '05 #1
1 1531
Hi Marek,

you are probably getting this error because by default ASP.NET account runs
with minimum privileges and hence it doesn't have access to such functions in
the AD. Either use impersonation or pass on the credentials of an user who
has the rights to change user passwords and it should work.

HTH.

Kaustav Neogy.

"Marek Kopanski" wrote:
Hallo,

I have to change a user password in my ASP.NET project.
In the first step I was trying to change my own passwort (as example) in
Active Directory on my Server, but already at this point I get problems.
Can somebody help me?

1. I use following fragment of code:
-----------------------------------
DirectoryEntry DirEntry;

DirEntry = new DirectoryEntry( @"WinNT://XXX-DOMAIN","MyName ","MyPassword") ;

DirEntry.Invoke ("setPasswor d", "testtest") ;

@"WinNT://XXX-DOMAIN"," is the name of the Server

2. Error
--------------------------------

The line:

DirEntry.Invoke ("setPasswor d", "testtest") ;

fires an error:

System.Runtime. InteropServices .COMException: unknown name.

Can somebody tell me, what I am doing wrong?

Greetings

Marek

Nov 19 '05 #2

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

Similar topics

0
1709
by: amusa | last post by:
When opening a visual basic project type and choosing an ASP .NEt template getting this error The Web Server Reported the following error when attempting to create or open the web project loaded at the following URL:'http://localhost/test". the server returned an invalid or unrecognized response' thanks for your help in advanced.
1
1539
by: Mike Tickner | last post by:
Can anyone help ? I have a ACC2000 database which has password set. Whenever I now open db I get error 3197 'The Microsoft Jet database engine has stopped the process because you and another user are attempting to change the same data at the same time' Why is does this occur when the correct password is submitted on accessing the database, and more critically what can I do to rectify the situation.
2
1535
by: Thomas Cameron | last post by:
Hello all, I have written an application in Visual Basic .Net 2003 which allows staff members to enable user accounts within a specific group in our Active Directory. However, as an added piece I would like to set a new password for the accounts as they are enabled. How can I do this in VB? Please also consider the fact that I do not know what the password was previously set to. Thomas Cameron
9
3096
by: Alessandro | last post by:
When I build a setup project under vb2005, starts "Microsoft sql server 2005 Tool" showing "Please wait while windows configures Microsoft sql server 2005 tools" Then it stop with this message: Failure setting security rights on users account SQLServer2005NotificationServicesUser$M2 If I give the user administrator rights it does not happen and buid goes right. I I remove the user from administrators the message is showed again. I...
4
1473
by: DR | last post by:
when i build someone's project, and right click a function "goto definition" is disabled. how to reconfigure a .net project to support "goto definition" when i right click on function calls?
0
8254
acoder
by: acoder | last post by:
Problem When setting the FORM object's action property an "Object does not support this property or method" error occurs Browser Internet Explorer 6- Example The Javascript code: var theForm = document.getElementById("formID"); theForm.action = "actionpage.php";
2
2678
by: Ronald S. Cook | last post by:
In my solution, I have a client (Windows app) and a class library. The class library project has a connection string setting that I would like to be able to change (from the client project ultimately). However, when I try to change the setting programmatically, it says it can't because it's read-only. This is not the case when I want to change a setting in the client project. Any idea what's up? If it matters, the class library has...
0
756
by: rote | last post by:
When using the PassWord recvovery server control do we need to set the enablePasswordRetrieval attribute to false or True of the configured membership?
2
36550
by: ALIYU HABIB | last post by:
I want to write a code on username and password authentication, but i can't display "*" when entering the password. I am using turbo c++ compiler.
0
9706
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
9584
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
10583
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...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
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
5525
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
4301
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
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.