IMetabaseUser.MustChangePasswordAtNextLogon

Syntax

MustChangePasswordAtNextLogon: Boolean;

Description

The MustChangePasswordAtNextLogon property determines the attribute of password change request during the next logon for the user.

Example

Sub Main;

Var

MB: IMetabase;

Sec: IMetabaseSecurity;

Group: IMetabaseGroup;

User: IMetabaseUser;

Data: ISecurityPackageUserData;

PS: IPasswordCredentials;

Begin

MB := MetabaseClass.Active;

Sec := MB.Security;

Group := Sec.AddGroup("A test group");

User := Sec.AddUser("TestUser");

User.FullName := "A test user";

Sec.Policy.Privilege("ENTER").Grant(User);

Sec.Policy.Privilege("READING").Grant(User);

Data := User.PackageData;

PS := Data.Credentials As IPasswordCredentials;

PS.Password := "Password";

User.MustChangePasswordAtNextLogon := True;

Group.AddMember(User);

Sec.Apply;

End Sub Main;

After executing the example a new group and a new user are created. The user is included to this group. Two privileges will be created for the user: the privilege for logging in the platform and the privilege for reading and opening objects. On the first login to the platform under this user, the request for password changing will be displayed.

See also:

IMetabaseUser