IMetabaseAuditUserInfo.CreateUser

Syntax

CreateUser(Password: String);

Parameters

Password. Service user password.

Description

The CreateUser method creates a service user in database.

Comments

For Microsoft SQL Server the password should meet the password complexity requirements.

After a new service user is created, add its credentials on each user's computer using the PP.Util utility.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AuditUser: IMetabaseAuditUserInfo;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    
// Get service user parameters
    AuditUser := MS.AuditUserInfo;
    
// Create a new service user if the P4AUDIT service user is reserved
    If AuditUser.IsReserved Then
        AuditUser.Name := 
"SERVICE_USER";
        AuditUser.Scope := AuditUserCredsScope.LocalMachine;
        AuditUser.CreateUser(
"wg5aj4");
    
End If;
    
// Save changes
    MS.Apply;
    
// Check in license
    Lic := Null;
End Sub UserProc;

After executing the example, a new service user of security subsystem will be created in the database, if the P4AUDIT service user was reserved in the repository. New service user credentials will be stored in the registry of a local computer and are available for use to all computer users.

See also:

IMetabaseAuditUserInfo