473,503 Members | 12,159 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
"setPassword" method. I am getting similar error and any help would
be appreciated. The error that I am getting is:

-------------------------------------------------
System.Reflection.TargetInvocationException: 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 "setpassword" 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
"setpassword" 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 AuthenticationType = Secure didnot work.

Thanks
Knea
Nov 18 '05 #1
2 1914
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 DirectoryServices.DirectoryEntry("LDAP://" &
s_ServerName, s_ADAuthUsername, s_ADAuthPassword)

Dim s_NewUser_User As DirectoryServices.DirectoryEntry
Try
s_NewUser_User = objDirEnt.Children.Add("CN=" &
s_UniqueCN, "user")
With s_NewUser_User.Properties
If s_EmployeeEmail <> "" Then .Item("mail").Value =
s_EmployeeEmail
If s_FullName <> "" Then .Item("sAMAccountName").Value =
s_FullName
End With

s_NewUser_User.Properties("userAccountControl").Va lue =
544
s_NewUser_User.CommitChanges()

Dim s_User As DirectoryServices.DirectoryEntry
s_User = LDAP_Connect(Me.s_PORTALLOCAL_ServerName
& "/CN=" & s_UniqueCN
& ",OU=ZackOU,OU=External,DC=PORTAL,DC=LOCAL",
Me.s_PORTALLOCAL_ADAuthUsername,
Me.s_PORTALLOCAL_ADAuthPassword)

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.CommitChanges()

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...
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...
9
3690
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...
6
2442
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...
11
31897
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
2075
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...
1
5942
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 =...
0
7264
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,...
1
6975
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...
0
7449
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...
1
4992
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...
0
4666
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...
0
3160
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...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
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 ...
1
728
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.