all groups > iis smtp nntp > june 2004 >
You're in the

iis smtp nntp

group:

user password management


user password management Dodo
6/28/2004 5:11:05 AM
iis smtp nntp:
anyone have any ides for members of the pop3 users group being able to
change their own passwords?

Re: user password management Ralf Ziller
6/28/2004 1:24:55 PM
"Dodo" <dodo@no.fly> schrieb im Newsbeitrag
news:eAj41gPXEHA.3168@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

There is no mechanism implemented for this in the POP3 protocol. You could
create a Asp(x) page that can do this.
Here's some code in c# you could use inside an aspx:

// get the DirectoryEntry for the User
DirectoryEntry entry = new DirectoryEntry(@"WinNT://<domain>/"+UserName);

//Passwords are passed in an Array containing the old and new password

object[] oPassword = new object[2];

// fill Array with Passwords obtained from Textboxes.

oPassword[0] = oldPass.Text;

oPassword[1] = newPass1.Text;

try

{

// Invoke the ChangePassword function for the user

entry.Invoke("ChangePassword", oPassword);

}

catch (System.Reflection.TargetInvocationException TIE)

{

System.Runtime.InteropServices.COMException ce =

(System.Runtime.InteropServices.COMException) TIE.InnerException;

if(ce.ErrorCode==-2147024810)

{// old Password does not match; inform the user...}

else

{

// other error... throw it up the stack

throw(ce);

}

}

finally

{

// close the DirectoryEntry

entry.Close();

}

AddThis Social Bookmark Button