Name: String;
Name: System.String;
The Name property returns a name of the domain.
The property is read-only.
To execute the example make sure that the security manager contains the DOMAIN_USER domain user with the access to workstations.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
User: IMetabaseUser;
St: IStations;
Dm: IDomains;
Domain: IDomain;
i: Integer;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
// Get domain user parameters
User := MS.ResolveName("DOMAIN_USER") As IMetabaseUser;
St := User.Stations;
Dm := St.Domains;
// Display domain user parameters to console
Domain := Dm.Item(0);
Debug.WriteLine("Domain: " + Domain.Name);
Debug.WriteLine("Description: " + Domain.Comment);
Debug.WriteLine("Access to workstations: ");
For i := 0 To Domain.Stations.Count - 1 Do
Debug.WriteLine(Domain.Stations.Item(i).Name);
End For;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
User: IMetabaseUser;
St: IStations;
Dm: IDomains;
Domain: IDomain;
i: Integer;
Begin
MB := Params.Metabase;
MS := MB.Security;
// Get domain user parameters
User := MS.ResolveName("DOMAIN_USER") As IMetabaseUser;
St := User.Stations;
Dm := St.Domains;
// Display domain user parameters to console
Domain := Dm.Item[0];
System.Diagnostics.Debug.WriteLine("Domain: " + Domain.Name);
System.Diagnostics.Debug.WriteLine("Description: " + Domain.Comment);
System.Diagnostics.Debug.WriteLine("Access to workstations: ");
For i := 0 To Domain.Stations.Count - 1 Do
System.Diagnostics.Debug.WriteLine(Domain.Stations.Item[i].Name);
End For;
End Sub;
After executing the example, the console will display user domain, description and list of allowed workstations.
See also: