Changing a user's windows password

From: Jackie_ol (jackie_ol_at_hotmail.com)
Date: 07/02/03


Date: Wed, 2 Jul 2003 02:24:30 -0700


Hi!
I used the following code to change a user's windows
password:

DirectoryEntry myDirectoryEntry;
string dirEntry = string.Format(@"WinNT://{0}/
{1},User", "COMPUTER_NAME", "cyberuser");
myDirectoryEntry = new DirectoryEntry(dirEntry);
myDirectoryEntry.Invoke("setPassword", "abcde");
myDirectoryEntry.CommitChanges();

This code works fine when I run it as a console
application. But when I run this code in a web service
method, the password doesn't change. I don't receive an
error or an exception, but the password remains the same.
Any solutions?

Thanks in advance.



Relevant Pages

  • Exception from HRESULT: 0x800700B6
    ... I developed an C# ASP.NET Web Service and 3rd party COM component is used in ... But I am getting the following error after migrating to Windows 2003 SP1 ... Exception from HRESULT: 0x800700B6. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Class Library for CF and .NET Framework
    ... What is the stack when you hit the exception? ... > desktop windows applications as well as .NET Compact Framework apps. ... > class library needs to make use of a web service. ...
    (microsoft.public.dotnet.framework.compactframework)
  • dll not loading in Web Service
    ... We have developed a Web service and we need to add a reference to a .net ... dll MyDll.dll which uses Win32 dlls. ... An unhandled exception occurred during the execution of the ... be loaded by the Web Service but can be loaded by the Windows Forms? ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Web service fails to run on Windows 2003
    ... What is your web service basically doing ?. ... of code that is throwing the exception ?. ... on Windows 2000 and XP. ... FUNCTION: ProcessFile: Loop for processing lines ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Changing a users windows password
    ... I guess ASP.NET process does not have permission to do this. ... > I used the following code to change a user's windows ... But when I run this code in a web service ... > error or an exception, but the password remains the same. ...
    (microsoft.public.dotnet.framework.aspnet.security)

Quantcast