DeleteUser() public method

Deletes the specified IAM user. The user must not belong to any groups or have any access keys, signing certificates, or attached policies.
/// The request was rejected because it attempted to delete a resource that has attached /// subordinate entities. The error message describes these entities. /// /// The request was rejected because it attempted to create resources beyond the current /// AWS account limits. The error message describes the limit exceeded. /// /// The request was rejected because it referenced an entity that does not exist. The /// error message describes the entity. /// /// The request processing has failed because of an unknown error, exception or failure. ///
public DeleteUser ( DeleteUserRequest request ) : Amazon.IdentityManagement.Model.DeleteUserResponse
request Amazon.IdentityManagement.Model.DeleteUserRequest Container for the necessary parameters to execute the DeleteUser service method.
return Amazon.IdentityManagement.Model.DeleteUserResponse
示例#1
0
 public static void DeleteTestUsers(AmazonIdentityManagementServiceClient client, params string[] usernames)
 {
     foreach (string s in usernames)
     {
         DeleteAccessKeysForUser(client, s);
         DeleteUserPoliciesForUser(client, s);
         DeleteCertificatesForUser(client, s);
         try 
         {
             client.DeleteLoginProfile(new DeleteLoginProfileRequest() { UserName = s }); 
         } catch { /* Nobody cares */ }
         client.DeleteUser(new DeleteUserRequest() { UserName = s });
     }
 }