Error trying to set an user's password to the Active Directory

J

José Manuel

Hi,

I'm getting the following Exception and Message when I try to set an user's
password in the Active Directory, I Would appreciate any help:

The Network path was not found

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: The Network path was not found:
System.IO.FileNotFoundException

Source Error:

Line 124: usuario.CommitChanges();
Line 125: entry.CommitChanges();
Line 126: object ret = usuario.Invoke("setPassword",new
object[]{txtPasswordI.Text});
Line 127: usuario.CommitChanges();
Line 128: entry.CommitChanges();
 
J

Jeffrey Tan[MSFT]

Hi Jos,

I have reviewed your issue, I will spend some time to do some research on
this issue. I will reply to you ASAP.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi Jos,

Sorry for letting you wait for so long time.

Actually, "The Network path was not found" exception may caused by a lot of
reasons.

Is your ADSI code execute in winForm application or Asp.net server side
application?
Can you show me the full code of your application?

To have a background description of "Password-Change Protocols in Windows
2000", please refer to:
http://support.microsoft.com/default.aspx?scid=kb;en-us;264480
also refer to:
"HOW TO: Enable SSL for All Customers Who Interact with Your Web Site in
Internet Information Services"
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q298805

First, you may try binding to the AD using cached credentials like:

DirectoryEntry user = new
DirectoryEntry("LDAP://cn=joe,cn=Users,dc=.....", ADUser, ADPassword,
AuthenticationTypes.Secure);
user.Invoke("SetPassword", new object[] {"Pa55W0rd123"});
user.CommitChanges();

Also, this problem may due to the DNS setting of your machine.

ADSI is built on LDAP which is built on TCP, after capturing a few network
packets, the server was attempting to resolve a machine name (via DNS) and
failing. Checking the DNS settings on the server revealed a
misconfiguration. Correcting the DNS settings may eliminate the error
message.

At last, if it still does not work, you may try to use WinNt provider to
have a try.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

José Manuel

Hi, thanx for your answer.

The environment is this:

Server :Windows 2000 Server= Domain Server- AD.
Development : Windows 2000 Professional. IIS.
Development machine is trying to set the password of a new User.

We can:

1.- Add an user to Active Directory.
2.- Enable that user.

We are not able to Set or change password.
My ADSI code is being execute in ASP.Net.

This is the code:


DirectoryEntry entry = new DirectoryEntry("LDAP://sofia/CN=Users,
DC=sofia,DC=domain,DC=com", "admin","pwdAdmin", AuthenticationTypes.Secure);

DirectoryEntry usuario = entry.Children.Add("cn=" +
txtUserNameI.Text,"user");

usuario.Properties["sn"].Add(txtUserNameI.Text);

usuario.Properties["name"].Add(txtUserNameI.Text);

usuario.Properties["userPrincipalName"].Add(txtUserNameI.Text);

usuario.Properties["samAccountName"].Add(txtUserNameI.Text);

usuario.CommitChanges();

entry.CommitChanges();

usuario.Invoke("SetPassword",new object[]{txtPasswordI.Text});

usuario.Properties["userAccountControl"].Value = 0x10240;

usuario.CommitChanges();

entry.CommitChanges();


I think the problem is SSL, the Question is... I need to configure the SSL
just in the AD Server? or I need to enable it too in the IIS Machine?

Thanx !!! =D
--
Este mensaje no implica responsabilidad alguna.

José Manuel
Programador
Accenture Technology Solutions


"Jeffrey Tan[MSFT]" said:
Hi Jos,

Sorry for letting you wait for so long time.

Actually, "The Network path was not found" exception may caused by a lot of
reasons.

Is your ADSI code execute in winForm application or Asp.net server side
application?
Can you show me the full code of your application?

To have a background description of "Password-Change Protocols in Windows
2000", please refer to:
http://support.microsoft.com/default.aspx?scid=kb;en-us;264480
also refer to:
"HOW TO: Enable SSL for All Customers Who Interact with Your Web Site in
Internet Information Services"
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q298805

First, you may try binding to the AD using cached credentials like:

DirectoryEntry user = new
DirectoryEntry("LDAP://cn=joe,cn=Users,dc=.....", ADUser, ADPassword,
AuthenticationTypes.Secure);
user.Invoke("SetPassword", new object[] {"Pa55W0rd123"});
user.CommitChanges();

Also, this problem may due to the DNS setting of your machine.

ADSI is built on LDAP which is built on TCP, after capturing a few network
packets, the server was attempting to resolve a machine name (via DNS) and
failing. Checking the DNS settings on the server revealed a
misconfiguration. Correcting the DNS settings may eliminate the error
message.

At last, if it still does not work, you may try to use WinNt provider to
have a try.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi Jos,

Thanks very much for your feedback.

As I think, you problem is most possible caused by 2 factors: the SSL or
the DNS setting.

Based on this article(I have pasted in last reply) "Password-Change
Protocols in Windows 2000", it states:
"When you are using LDAP (method 5), the domain controller and the client
must both be able to use 128-bit SSL to protect the connection."

So you should enable the SSL for both client machine and your server
machine.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi Jos,

Does the my reply make sense to you? Is your problem resolved?

Please feel free to feedback, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top