Amazon AWS SDK Guida Utente Pagina 100

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 99
{
Console.WriteLine(" {0}", accessKey.Id);
}
}
Get Group Information
The following example displays information about an existing group, including its associated policies and
user accounts:
// using Amazon.IdentityManagement.Resources;
// using Amazon.IdentityManagement.Model;
var iam = new IdentityManagementService();
try
{
var group = iam.GetGroupByName("DemoGroup");
Console.WriteLine("For group {0}:", group.Name);
Console.WriteLine(" Policies:");
foreach (var policy in group.GetPolicies())
{
Console.WriteLine(" {0}", policy.Name);
}
Console.WriteLine(" Users:");
foreach (var user in group.GetUsers())
{
Console.WriteLine(" {0}", user.Name);
}
}
catch (NoSuchEntityException)
{
Console.WriteLine("Group 'DemoGroup' does not exist.");
}
The following example displays a list of all accessible groups. For each group, its associated policies and
user accounts are also displayed:
// using Amazon.IdentityManagement.Resources;
var iam = new IdentityManagementService();
var groups = iam.GetGroups();
foreach (var group in groups)
{
Console.WriteLine("For group {0}:", group.Name);
Console.WriteLine(" Policies:");
foreach (var policy in group.GetPolicies())
{
Console.WriteLine(" {0}", policy.Name);
Version v2.0.0
96
AWS SDK for .NET Developer Guide
IAM Resource API Examples
Vedere la pagina 99
1 2 ... 95 96 97 98 99 100 101 102 103 104 105 ... 154 155

Commenti su questo manuale

Nessun commento