MaxAge: Integer;
The MaxAge property determines the maximum password age (days).
To execute the example, add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
MU: IMetabasePolicy;
PassPol: IMetabasePasswordPolicy;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
MU := MS.Policy;
PassPol := MU.PasswordPolicy;
// Set maximum password age (days)
PassPol.MaxAge := 90;
PassPol.WarningMaxAge := 5;
// Save changes
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example the maximum password age is set as 90 days and the notification about the necessity of changing password 5 days before it expires is enabled.
See also: