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

Home Posts Topics Members FAQ

Active Directory - setPassword method error

Hi,

I noticed a bunch of postings about getting error while invoking the
"setPasswor d" method. I am getting similar error and any help would
be appreciated. The error that I am getting is:

-------------------------------------------------
System.Reflecti on.TargetInvoca tionException: Exception has been thrown
by the target of an invocation. --->
System.Runtime. InteropServices .COMException (0x8007052E): Logon
failure: unknown user name or bad password.
--- End of inner exception stack trace ---
-------------------------------------------------

Before I call my "setpasswor d" method, I have already enabled the
account and have called CommitChanges() method. I am using ASP.Net
with VB.Net.

I read somewhere that I need to use a secure connection to call the
"setpasswor d" method. Is this true? if yes then please give me some
more details as to how I can connect securely to my Active Directory
server. Passing AuthenticationT ype = Secure didnot work.

Thanks
Knea
Nov 18 '05 #1
2 1927
You may have to give some code to help others start working on this
issue and also as to how you have setup your web application.

Does it do Impersonation with Windows Authentication. Is IIS configured
to use Basic Authentication etc.

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
The code for this error is below:

Dim objDirEnt As New DirectoryServic es.DirectoryEnt ry("LDAP://" &
s_ServerName, s_ADAuthUsernam e, s_ADAuthPasswor d)

Dim s_NewUser_User As DirectoryServic es.DirectoryEnt ry
Try
s_NewUser_User = objDirEnt.Child ren.Add("CN=" &
s_UniqueCN, "user")
With s_NewUser_User. Properties
If s_EmployeeEmail <> "" Then .Item("mail").V alue =
s_EmployeeEmail
If s_FullName <> "" Then .Item("sAMAccou ntName").Value =
s_FullName
End With

s_NewUser_User. Properties("use rAccountControl ").Value =
544
s_NewUser_User. CommitChanges()

Dim s_User As DirectoryServic es.DirectoryEnt ry
s_User = LDAP_Connect(Me .s_PORTALLOCAL_ ServerName
& "/CN=" & s_UniqueCN
& ",OU=ZackOU,OU= External,DC=POR TAL,DC=LOCAL",
Me.s_PORTALLOCA L_ADAuthUsernam e,
Me.s_PORTALLOCA L_ADAuthPasswor d)

Try
s_User.Invoke(" setPassword", New Object()
{"Password"} )
Catch e As Exception
s_ReturnMsg = "Error in Setting Password. Error: "
& e.ToString
End Try
s_User.CommitCh anges()

Thanks
Knea
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

0
2785
by: microsoft | last post by:
Hi People, when I try to modify an active directory user programatically, I receive the following exception: The server is unwilling to process the request Reading the microsoft web site, I found this article: http://support.microsoft.com/default.aspx?scid=kb;EN-US;248717 that says the following: ..........................
5
1022
by: Mario Rodriguez | last post by:
Hi people, Does anyone have some idea how to get the password of an active directory user? I tried using the DirectorySearcher object to find the user and the DirectoryEntry.Password property to get the value, but always returns "null" and I'm totally sure that the password is not null thanks
9
3736
by: Mario Rodriguez | last post by:
Hi people. I have a problem adding users to Win2003 active directory programatically. When I execute my app throws the following exception: .................The specified directory service attribute or value does not exist........... Exactly the same code works fine on my win2000 active directory. My app include the use of the extensionAtributes and I'm not sure if the extensionAttributes feature was removed from win2003 Active...
6
2459
by: Diego Valencia | last post by:
The attach error was generate when I tried to use invoke method "setpassword" this is mi code objeto.Invoke("SetPassword", new object {contraseña}); The error is "The filename, directory name, or volume label syntax is incorrect" Exception Detail : System.IO.FileNotFoundException:The filename, directory
11
31957
by: Jet Leung | last post by:
Hi all, How can I modify users in Active Directory ? Actually , I want to change the Active Directory user password . But how can I do that?
4
2110
by: Marc | last post by:
So I am having some issues with code written by another developer that interfaces with Active Directory. We had a catastrophic failure on the server and had to recreate the AD. No the following code does not work: DirectoryEntry ou = new DirectoryEntry("LDAP://ou=WISDM,dc=WISDM,dc=wisdm,dc=org", "username", "password"); // Use the Add method to add a user in an organizational unit. DirectoryEntry usr = ou.Children.Add("CN=" +...
1
5969
by: Marko G. | last post by:
Hallo, ich versuche nun seit einiger Zeit, auf einem Active-Directory Server das Passwort eines Benutzers zu setzen. Hier der verwendete Quelltext: ------------ Dim entry As DirectoryEntry = New DirectoryEntry(_path, _useranddomain, _UserPwd) Dim search As DirectorySearcher = New DirectorySearcher(entry) search.Filter = "(samaccountname=" & username & ")"
0
9585
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
10586
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
10082
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...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
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...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
3
2997
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.