Class Passwd_Driver_pspasswd

Description

The PSPasswd class changes a user's password on any Windows Machine (NT+) using the pspasswd free utility available at Sysinternals website: http://www.sysinternals.com/ntw2k/freeware/pspasswd.shtml

IMPORTANT!

This driver should be used only as a last resort when there's no possibility of using the ADSI or LDAP drivers, which are far more secure and fast. This driver needs administrative credentials exposed on the backends.php file, which is required by the pspasswd.exe tool. It's an alternative driver that should be avoided, but could also be the only option for a few scenarios. (eg: When you don't have ADSI or LDAP support)

Sample backend configuration:

  1.  $backends['pspasswd'array(
  2.    'name' => 'Sample pspasswd backend',
  3.    'preferred' => 'localhost',
  4.    'password policy' => array(
  5.        'minLength' => 8,
  6.        'maxLength' => 14
  7.    ),
  8.    'driver' => 'pspasswd',
  9.    'params' => array(
  10.          'server' => 'YOUR_SERVER_NAME',
  11.          'bin' => 'DRIVE:\\DIR\\pspasswd.exe'// Notice: "\\"
  12.          'admusr' => 'Administrator',
  13.            'admpwd' => 'Password',
  14.        'domain' => 'YOUR_DOMAIN_NAME'
  15.    )
  16.  );

Backend parameters:

 server	= Machine where you want to change the password (Required)
 bin		= Full pathname of the pspasswd.exe program (Required)
 admusr	= User with administrative privileges (Required)
 admpwd	= Password of the administrative user (Required)
 domain	= Windows domain name (Optional)

For example: Passing a NT4 PDC server name to the server parameter means you can change the user's password on that NT4 Domain.

Special thanks to Mark Russinovich (mark@sysinternals.com) for the tool and helping me solve some questions about it.

$Horde: passwd/lib/Driver/pspasswd.php,v 1.2.2.5 2009/01/06 15:25:23 jan Exp $

Copyright 2004-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.php.

  • author: Luiz R Malheiros (malheiros@gmail.com)
  • since: Passwd 3.0

Located in /lib/Driver/pspasswd.php (line 62)

Passwd_Driver
   |
   --Passwd_Driver_pspasswd
Method Summary
 void changePassword ( $user_name,  $old_password,  $new_password)
Variables
Methods
changePassword (line 64)
void changePassword ( $user_name,  $old_password,  $new_password)
  • $user_name
  • $old_password
  • $new_password

Redefinition of:
Passwd_Driver::changePassword()
Change the user's password.

Inherited Methods

Inherited From Passwd_Driver

 Passwd_Driver::Passwd_Driver()
 Passwd_Driver::changePassword()
 Passwd_Driver::comparePasswords()
 Passwd_Driver::encryptPassword()
 Passwd_Driver::factory()

Documentation generated on Sun, 30 Jan 2011 05:36:08 +0000 by phpDocumentor 1.4.3