Item(Index: Integer): IDomain;
Item[System.Int32]: Prognoz.Platform.Interop.Metabase.IDomain;
Index. Domain index in collection.
The Item property returns a domain from the collection by its index.
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 method.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Sec: IMetabaseSecurity;
User: IMetabaseUser;
St: IStations;
Dm: IDomains;
i: Integer;
Begin
MB := MetabaseClass.Active;
Sec := MB.Security;
// Get domain user parameters
User := Sec.ResolveName("DOMAIN_USER") As IMetabaseUser;
St := User.Stations;
Dm := St.Domains;
// Display the list of available domains to the console
For i := 0 To Dm.Count - 1 Do
Debug.WriteLine(Dm.Item(i).Name);
End For;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Sec: IMetabaseSecurity;
User: IMetabaseUser;
St: IStations;
Dm: IDomains;
i: Integer;
Begin
MB := Params.Metabase;
Sec := MB.Security;
// Get domain user parameters
User := Sec.ResolveName("DOMAIN_USER") As IMetabaseUser;
St := User.Stations;
Dm := St.Domains;
// Display the list of available domains to the console
For i := 0 To Dm.Count - 1 Do
System.Diagnostics.Debug.WriteLine(Dm.Item[i].Name);
End For;
End Sub;
After executing the example, the console will display a list of domains to which belong workstations in the DOMAIN_USER user collection.
See also: