ChangePassword

ActiveX/VBSScript registry editor  ActiveX NT User account manager  Export MDB/DBF from ASP
Url replacer, IIS url rewrite Active LogFile  Email export  ActiveX/ASP Scripting Dictionary object
 IISTracer, real-time IIS monitor
 Huge ASP upload - upload files with progress.
          Method 
          Member of  UserManager.Server 

Description

Changes password for the currently logged on user.

Syntax

Server.ChangePassword (OldPassword as String, NewPassword as String)
 
Where Type Optional Default Description
 OldPassword  String     User’s old password on the server or domain. 
 NewPassword  String     User’s new password on the server or domain. 

Remarks

There are some differences between UserManager.Server.ChangePassword method and UserManager.User.Password write property.
- ChangePassword method of Server object can call only logged-on user. There is no need to know user name, password for current user is to change. But user must know an old password. Similar like crtl-alt-del -> change password.
- Password write property of User object can call ONLY administrator (or account operator). You do not need to know an old password. Similar like account manager -> set password.

Examples

 Change password from an HTML page (directly in IE/CHM/HTA)  
Old password : New password :
Source code for this Script:

<form Name=Password>
 Old password : <input Name=OldPassword> 
 New password : <input Name=NewPassword>
 <input type=button onclick="ChangePassword()" Value="Change Password">
</form>

<script language=vbscript>
 Function ChangePassword()
  Set Server = CreateObject("UserManager.Server")
  Server.Select ""
  Server.ChangePassword document.forms.Password.OldPassword.Value, document.forms.Password.NewPassword.Value
  MsgBox "Password was changed to " & document.forms.Password.NewPassword.Value
 End Function
</script>

 Change password from an ASP page.  
  Other links for ChangePassword

Properties of Server class

UserManager.Server

Properties of servers, enumerating users, logon/logoff to the user administrator account.

UserManager

Easy to use classes to create, delete and manage local and remote user accounts, groups, servers and domains in the Windows NT (2000/XP) environment. Simple work with user accounts and groups from VBA, VBS/JS, ASP and T-SQL.

© 1996 – 2006 Antonin Foller, Motobit Software, help{at}pstruh.cz, help v. 2.03.68