Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Use ResyncMfaDevice
with an Amazon SDK or command line tool
The following code examples show how to use ResyncMfaDevice
.
- CLI
-
- Amazon CLI
-
To synchronize an MFA device
The following resync-mfa-device
example synchronizes the MFA device that is associated with the IAM user Bob
and whose ARN is arn:aws:iam::123456789012:mfa/BobsMFADevice
with an authenticator program that provided the two authentication codes.
aws iam resync-mfa-device \
--user-name Bob \
--serial-number arn:aws:iam::210987654321:mfa/BobsMFADevice \
--authentication-code1 123456 \
--authentication-code2 987654
This command produces no output.
For more information, see Using multi-factor authentication (MFA) in Amazon in the Amazon IAM User Guide.
- PowerShell
-
- Tools for PowerShell
-
Example 1: This example synchronizes the MFA device that is associated with the IAM user Bob
and whose ARN is arn:aws:iam::123456789012:mfa/bob
with an authenticator program that provided the two authentication codes.
Sync-IAMMFADevice -SerialNumber arn:aws:iam::123456789012:mfa/theresa -AuthenticationCode1 123456 -AuthenticationCode2 987654 -UserName Bob
Example 2: This example synchronizes the IAM MFA device that is associated with the IAM user Theresa
with a physical device that has the serial number ABCD12345678
and that provided the two authentication codes.
Sync-IAMMFADevice -SerialNumber ABCD12345678 -AuthenticationCode1 123456 -AuthenticationCode2 987654 -UserName Theresa
For a complete list of Amazon SDK developer guides and code examples, see
Using IAM with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.