Password

Description

Sets or returns the user's HCL Compass username password. GetPassword returns the encrypted password.

You can use SetLoginName to set a user login name password. For LDAP authentication, the Compass user name and the login name may not be the same.

Note: You cannot use the return value of the Password (GetPassword for Perl) method as an argument in the UserLogon method of the Session object.

Syntax

VBScript


user.Password 
user.Password passwd_string 

Perl


$user->GetPassword();
$user->SetPassword(passwd_string); 
Identifier
Description
user
A User object.
passwd_string
A String specifying the user's new password.
Return value
A String containing the user's password.

Example

Perl

use CQPerlExt;

# Create an admin session
my $adminSession = CQAdminSession::Build();

# Logon as admin
$adminSession->Logon( "admin", "admin", "" );

# Create the user "jsmith" object
my $newUserObj = $adminSession->CreateUser( "jsmith" );
die "Unable to create the user!\n" unless $newUserObj;

# Set the new user's password to secret
$newUserObj->SetPassword("secret");

# All done.
CQAdminSession::Unbuild($adminSession);