Example 1
Request-IAMCredentialReport
Description State
----------- -----
No report exists. Starting a new report generation task STARTED
Get-IAMCredentialReport -AsTextArray
user,arn,user_creation_time,password_enabled,password_last_used,password_last_changed,password_next_rotation,mfa_active,access_key_1_active,access_key_1_last_rotated,access_key_2_active,access_key_2_last_rotated,cert_1_active,cert_1_last_rotated,cert_2_active,cert_2_last_rotated ,arn:aws:iam::123456789012:root,2014-10-15T16:31:25+00:00,not_supported,2015-04-20T17:41:10+00:00,not_supported,not_supported,true,false,N/A,false,N/A,false,N/A,false,N/A
Administrator,arn:aws:iam::123456789012:user/Administrator,2014-10-16T16:03:09+00:00,true,2015-04-20T15:18:32+00:00,2014-10-16T16:06:00+00:00,N/A,false,true,2014-12-03T18:53:41+00:00,true,2015-03-25T20:38:14+00:00,false,N/A,false,N/A
Bill,arn:aws:iam::123456789012:user/Bill,2015-04-15T18:27:44+00:00,false,N/A,N/A,N/A,false,false,N/A,false,N/A,false,2015-04-20T20:00:12+00:00,false,N/A
This example opens the returned report and outputs it to the pipeline as an array of text lines. The first line is the header with comma-separated column names. Each successive row is the detail row for one user, with each field separated by commas.
Before you can view the report, you must generate it with the Request-IAMCredentialReport
cmdlet.
To retrieve the report as a single string, use -Raw
instead of -AsTextArray
. The alias -SplitLines
is also accepted for the -AsTextArray
switch. For the full list of columns in the output consult the service API reference. Note that if you do not use -AsTextArray
or -SplitLines
, then you must extract the text from the .Content
property using the .NET StreamReader
class.