File_SMBPasswd::modAccountEncrypted() – modify an existing account with the given encrypted password.


mixed File_SMBPasswd::modAccountEncrypted ( string $user , int $userid , string $nthash = '' , string $lmhash = '' , string $comment = '' , string $flags = '' )


Modifies an existing account using pre-encrypted passwords.


  • string $user - username to be added

  • int $userid - userid of the user

  • string $nthash - new NT-Hash

  • string $lmhash - new LM-Hash

  • string $comment - comment

  • string $flags - flags

Return value

mixed - Returns TRUE on success, PEAR_Error on failure.


This function can not be called statically.

Note that the user to be added must already exist in the system password file.


Using File_SMBPasswd::modAccountEncrypted()

require_once 'File/SMBPasswd.php';

// modify user mbretter
$fh = new File_SMBPasswd('/usr/local/private/smbpasswd');
$status $fh->modAccountEncrypted(
Michaela Bretterklieber');
if (PEAR::isError($status)) {
    // handle errors
} else {

add a new maschine-account with the given plaintext-password. (Previous) modify an exsting account with the given plaintext-password. (Next)
Last updated: Mon, 05 Oct 2015 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.