NameCriteria: String;
The NameCriteria property determines a name of the desired security subject.
The following can be specified as value of the property:
Subject name.
Name of a domain subject (the DomainSelectCriteria property controls whether to specify domain).
Template, based on which several security subjects are searched.
The template enables using the substitute character *, that means that zero or more symbols can coincide, for example, "User*".
If requirement to specify domain or domain controller is set in the DomainSelectCriteria property, value for NameCriteria is set in one of the following formats:
To specify domain: <domain>\<subject> or <subject>@<domain.dns>.
To specify domain controller: <domain>\<dc>\<subject>, <dc>.<domain.dns>\<subject> or <subject>@<dc>.<domain.dns>.
Sub SubjectsSearch;
Var
MB: IMetabase;
Search: ISecuritySubjectsSearch;
Subjects: ISecuritySubjects;
Subject: ISecuritySubject;
Begin
MB := MetabaseClass.Active;
Search := MB.Security.NewSubjectsSearch;
Search.NameCriteria := "Ar*";
Search.SubjectCriteria(SecuritySubjectType.User) := True;
Search.SubjectCriteria(SecuritySubjectType.Group) := True;
Search.AreaIncludeDB := True;
Search.AreaIncludeNT := True;
Search.ExecuteSearch;
Subjects := Search.Subjects;
If Subjects.Count > 0 Then
For Each Subject In Subjects Do
Debug.WriteLine(Subject.Name + ": " + Subject.Description);
End For;
End If;
End Sub SubjectsSearch;
Security subjects - users and groups among domain subjects and DBMS subjects - are searches for when executing the example. Names and description of the found subjects are displayed in the console window.
See also: