

Versi 5 (V5) dari Alat AWS untuk PowerShell telah dirilis\$1

Untuk informasi tentang melanggar perubahan dan memigrasi aplikasi Anda, lihat [topik migrasi](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html).

 [https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html)

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Contoh IAM menggunakan Alat untuk V5 PowerShell
<a name="powershell_iam_code_examples"></a>

Contoh kode berikut menunjukkan cara melakukan tindakan dan mengimplementasikan skenario umum dengan menggunakan Alat AWS untuk PowerShell V5 dengan IAM.

*Tindakan* merupakan kutipan kode dari program yang lebih besar dan harus dijalankan dalam konteks. Sementara tindakan menunjukkan cara memanggil fungsi layanan individual, Anda dapat melihat tindakan dalam konteks dalam skenario terkait.

Setiap contoh menyertakan tautan ke kode sumber lengkap, di mana Anda dapat menemukan instruksi tentang cara mengatur dan menjalankan kode dalam konteks.

**Topics**
+ [Tindakan](#actions)

## Tindakan
<a name="actions"></a>

### `Add-IAMClientIDToOpenIDConnectProvider`
<a name="iam_AddClientIdToOpenIdConnectProvider_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Add-IAMClientIDToOpenIDConnectProvider`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini menambahkan ID klien (atau audiens) `my-application-ID` ke penyedia OIDC yang ada bernama. `server.example.com`**  

```
Add-IAMClientIDToOpenIDConnectProvider -ClientID "my-application-ID" -OpenIDConnectProviderARN "arn:aws:iam::123456789012:oidc-provider/server.example.com"
```
+  Untuk detail API, lihat [AddClientIdToOpenIdConnectProvider](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Add-IAMRoleTag`
<a name="iam_TagRole_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Add-IAMRoleTag`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menambahkan tag ke Peran dalam Layanan Manajemen Identitas**  

```
Add-IAMRoleTag -RoleName AdminRoleacess -Tag @{ Key = 'abac'; Value = 'testing'}
```
+  Untuk detail API, lihat [TagRole](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Add-IAMRoleToInstanceProfile`
<a name="iam_AddRoleToInstanceProfile_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Add-IAMRoleToInstanceProfile`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini menambahkan peran bernama `S3Access` ke profil instance yang ada bernama`webserver`. Untuk membuat profil instance, gunakan `New-IAMInstanceProfile` perintah. Setelah Anda membuat profil instance dan mengaitkannya dengan peran menggunakan perintah ini, Anda dapat melampirkannya ke sebuah EC2 instance. Untuk melakukan itu, gunakan `New-EC2Instance` cmdlet dengan `InstanceProfile-Name` parameter `InstanceProfile_Arn` atau untuk meluncurkan instance baru.**  

```
Add-IAMRoleToInstanceProfile -RoleName "S3Access" -InstanceProfileName "webserver"
```
+  Untuk detail API, lihat [AddRoleToInstanceProfile](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Add-IAMUserTag`
<a name="iam_TagUser_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Add-IAMUserTag`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menambahkan tag ke Pengguna di Layanan Manajemen Identitas**  

```
Add-IAMUserTag -UserName joe -Tag @{ Key = 'abac'; Value = 'testing'}
```
+  Untuk detail API, lihat [TagUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Add-IAMUserToGroup`
<a name="iam_AddUserToGroup_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Add-IAMUserToGroup`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini menambahkan nama pengguna `Bob` ke grup bernama`Admins`.**  

```
Add-IAMUserToGroup -UserName "Bob" -GroupName "Admins"
```
+  Untuk detail API, lihat [AddUserToGroup](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Disable-IAMMFADevice`
<a name="iam_DeactivateMfaDevice_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Disable-IAMMFADevice`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini menonaktifkan perangkat MFA perangkat keras yang terkait dengan `Bob` pengguna yang memiliki nomor seri. `123456789012`**  

```
Disable-IAMMFADevice -UserName "Bob" -SerialNumber "123456789012"
```
**Contoh 2: Perintah ini menonaktifkan perangkat MFA virtual yang terkait dengan `David` pengguna yang memiliki ARN. `arn:aws:iam::210987654321:mfa/David` Perhatikan bahwa perangkat MFA virtual tidak dihapus dari akun. Perangkat virtual masih ada dan muncul di output `Get-IAMVirtualMFADevice` perintah. Sebelum Anda dapat membuat perangkat MFA virtual baru untuk pengguna yang sama, Anda harus menghapus yang lama dengan menggunakan perintah. `Remove-IAMVirtualMFADevice`**  

```
Disable-IAMMFADevice -UserName "David" -SerialNumber "arn:aws:iam::210987654321:mfa/David"
```
+  Untuk detail API, lihat [DeactivateMfaDevice](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Edit-IAMPassword`
<a name="iam_ChangePassword_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Edit-IAMPassword`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mengubah kata sandi untuk pengguna yang menjalankan perintah. Perintah ini hanya dapat dipanggil oleh pengguna IAM. Jika perintah ini dipanggil ketika Anda masuk dengan kredensyal AWS akun (root), perintah mengembalikan kesalahan. `InvalidUserType`**  

```
Edit-IAMPassword -OldPassword "MyOldP@ssw0rd" -NewPassword "MyNewP@ssw0rd"
```
+  Untuk detail API, lihat [ChangePassword](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Enable-IAMMFADevice`
<a name="iam_EnableMfaDevice_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Enable-IAMMFADevice`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini memungkinkan perangkat MFA perangkat keras dengan nomor seri `987654321098` dan mengaitkan perangkat dengan pengguna. `Bob` Ini termasuk dua kode pertama secara berurutan dari perangkat.**  

```
Enable-IAMMFADevice -UserName "Bob" -SerialNumber "987654321098" -AuthenticationCode1 "12345678" -AuthenticationCode2 "87654321"
```
**Contoh 2: Contoh ini membuat dan mengaktifkan perangkat MFA virtual. Perintah pertama membuat perangkat virtual dan mengembalikan representasi objek perangkat dalam variabel`$MFADevice`. Anda dapat menggunakan `QRCodePng` properti `.Base32StringSeed` atau untuk mengkonfigurasi aplikasi perangkat lunak pengguna. Perintah terakhir menetapkan perangkat kepada pengguna`David`, mengidentifikasi perangkat dengan nomor serinya. Perintah ini juga menyinkronkan perangkat AWS dengan memasukkan dua kode pertama secara berurutan dari perangkat MFA virtual.**  

```
$MFADevice = New-IAMVirtualMFADevice -VirtualMFADeviceName "MyMFADevice"
# see example for New-IAMVirtualMFADevice to see how to configure the software program with PNG or base32 seed code
Enable-IAMMFADevice -UserName "David" -SerialNumber -SerialNumber $MFADevice.SerialNumber -AuthenticationCode1 "24681357" -AuthenticationCode2 "13572468"
```
+  Untuk detail API, lihat [EnableMfaDevice](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMAccessKey`
<a name="iam_ListAccessKeys_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMAccessKey`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mencantumkan kunci akses untuk pengguna IAM bernama`Bob`. Perhatikan bahwa Anda tidak dapat mencantumkan kunci akses rahasia untuk pengguna IAM. Jika kunci akses rahasia hilang, Anda harus membuat kunci akses baru dengan `New-IAMAccessKey` cmdlet.**  

```
Get-IAMAccessKey -UserName "Bob"
```
**Output:**  

```
AccessKeyId                CreateDate                   Status              UserName
-----------                ----------                   ------              --------
AKIAIOSFODNN7EXAMPLE       12/3/2014 10:53:41 AM        Active              Bob
AKIAI44QH8DHBEXAMPLE       6/6/2013 8:42:26 PM          Inactive            Bob
```
+  Untuk detail API, lihat [ListAccessKeys](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMAccessKeyLastUsed`
<a name="iam_GetAccessKeyLastUsed_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMAccessKeyLastUsed`.

**Alat untuk PowerShell V5**  
**Contoh 1: Mengembalikan nama pengguna yang dimiliki dan informasi penggunaan terakhir untuk kunci akses yang disediakan.**  

```
Get-IAMAccessKeyLastUsed -AccessKeyId ABCDEXAMPLE
```
+  Untuk detail API, lihat [GetAccessKeyLastUsed](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMAccountAlias`
<a name="iam_ListAccountAliases_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMAccountAlias`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mengembalikan alias akun untuk. Akun AWS**  

```
Get-IAMAccountAlias
```
**Output:**  

```
ExampleCo
```
+  Untuk detail API, lihat [ListAccountAliases](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMAccountAuthorizationDetail`
<a name="iam_GetAccountAuthorizationDetails_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMAccountAuthorizationDetail`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan rincian otorisasi tentang identitas di AWS akun, dan menampilkan daftar elemen objek yang dikembalikan, termasuk pengguna, grup, dan peran. Misalnya, `UserDetailList` properti menampilkan detail tentang pengguna. Informasi serupa tersedia di `RoleDetailList` dan `GroupDetailList` properti.**  

```
$Details=Get-IAMAccountAuthorizationDetail
$Details
```
**Output:**  

```
GroupDetailList : {Administrators, Developers, Testers, Backup}
IsTruncated     : False
Marker          : 
RoleDetailList  : {TestRole1, AdminRole, TesterRole, clirole...}
UserDetailList  : {Administrator, Bob, BackupToS3, }
```

```
$Details.UserDetailList
```
**Output:**  

```
Arn            : arn:aws:iam::123456789012:user/Administrator
CreateDate     : 10/16/2014 9:03:09 AM
GroupList      : {Administrators}
Path           : /
UserId         : AIDACKCEVSQ6CEXAMPLE1
UserName       : Administrator
UserPolicyList : {}

Arn            : arn:aws:iam::123456789012:user/Bob
CreateDate     : 4/6/2015 12:54:42 PM
GroupList      : {Developers}
Path           : /
UserId         : AIDACKCEVSQ6CEXAMPLE2
UserName       : bab
UserPolicyList : {}

Arn            : arn:aws:iam::123456789012:user/BackupToS3
CreateDate     : 1/27/2015 10:15:08 AM
GroupList      : {Backup}
Path           : /
UserId         : AIDACKCEVSQ6CEXAMPLE3
UserName       : BackupToS3
UserPolicyList : {BackupServicePermissionsToS3Buckets}
```
+  Untuk detail API, lihat [GetAccountAuthorizationDetails](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMAccountPasswordPolicy`
<a name="iam_GetAccountPasswordPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMAccountPasswordPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan detail tentang kebijakan kata sandi untuk akun saat ini. Jika tidak ada kebijakan kata sandi yang ditentukan untuk akun, perintah mengembalikan `NoSuchEntity` kesalahan.**  

```
Get-IAMAccountPasswordPolicy
```
**Output:**  

```
AllowUsersToChangePassword : True
ExpirePasswords            : True
HardExpiry                 : False
MaxPasswordAge             : 90
MinimumPasswordLength      : 8
PasswordReusePrevention    : 20
RequireLowercaseCharacters : True
RequireNumbers             : True
RequireSymbols             : False
RequireUppercaseCharacters : True
```
+  Untuk detail API, lihat [GetAccountPasswordPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMAccountSummary`
<a name="iam_GetAccountSummary_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMAccountSummary`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan informasi tentang penggunaan entitas IAM saat ini dan kuota entitas IAM saat ini di. Akun AWS**  

```
Get-IAMAccountSummary
```
**Output:**  

```
Key                                        Value
Users                                      7
GroupPolicySizeQuota                       5120
PolicyVersionsInUseQuota                   10000
ServerCertificatesQuota                    20
AccountSigningCertificatesPresent          0
AccountAccessKeysPresent                   0
Groups                                     3
UsersQuota                                 5000
RolePolicySizeQuota                        10240
UserPolicySizeQuota                        2048
GroupsPerUserQuota                         10
AssumeRolePolicySizeQuota                  2048
AttachedPoliciesPerGroupQuota              2
Roles                                      9
VersionsPerPolicyQuota                     5
GroupsQuota                                100
PolicySizeQuota                            5120
Policies                                   5
RolesQuota                                 250
ServerCertificates                         0
AttachedPoliciesPerRoleQuota               2
MFADevicesInUse                            2
PoliciesQuota                              1000
AccountMFAEnabled                          1
Providers                                  2
InstanceProfilesQuota                      100
MFADevices                                 4
AccessKeysPerUserQuota                     2
AttachedPoliciesPerUserQuota               2
SigningCertificatesPerUserQuota            2
PolicyVersionsInUse                        4
InstanceProfiles                           1
...
```
+  Untuk detail API, lihat [GetAccountSummary](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMAttachedGroupPolicyList`
<a name="iam_ListAttachedGroupPolicies_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMAttachedGroupPolicyList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mengembalikan nama dan kebijakan ARNs terkelola yang dilampirkan ke grup IAM yang disebutkan `Admins` di AWS akun. Untuk melihat daftar kebijakan sebaris yang disematkan dalam grup, gunakan `Get-IAMGroupPolicyList` perintah.**  

```
Get-IAMAttachedGroupPolicyList -GroupName "Admins"
```
**Output:**  

```
PolicyArn                                                 PolicyName
---------                                                 ----------
arn:aws:iam::aws:policy/SecurityAudit                     SecurityAudit
arn:aws:iam::aws:policy/AdministratorAccess               AdministratorAccess
```
+  Untuk detail API, lihat [ListAttachedGroupPolicies](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMAttachedRolePolicyList`
<a name="iam_ListAttachedRolePolicies_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMAttachedRolePolicyList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mengembalikan nama dan kebijakan ARNs terkelola yang dilampirkan pada peran IAM yang disebutkan `SecurityAuditRole` di AWS akun. Untuk melihat daftar kebijakan sebaris yang disematkan dalam peran, gunakan `Get-IAMRolePolicyList` perintah.**  

```
Get-IAMAttachedRolePolicyList -RoleName "SecurityAuditRole"
```
**Output:**  

```
PolicyArn                                                 PolicyName
---------                                                 ----------
arn:aws:iam::aws:policy/SecurityAudit                     SecurityAudit
```
+  Untuk detail API, lihat [ListAttachedRolePolicies](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMAttachedUserPolicyList`
<a name="iam_ListAttachedUserPolicies_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMAttachedUserPolicyList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mengembalikan nama dan kebijakan ARNs terkelola untuk pengguna IAM yang disebutkan `Bob` di AWS akun. Untuk melihat daftar kebijakan inline yang disematkan di pengguna IAM, gunakan perintah. `Get-IAMUserPolicyList`**  

```
Get-IAMAttachedUserPolicyList -UserName "Bob"
```
**Output:**  

```
PolicyArn                                                 PolicyName
---------                                                 ----------
arn:aws:iam::aws:policy/TesterPolicy                      TesterPolicy
```
+  Untuk detail API, lihat [ListAttachedUserPolicies](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMContextKeysForCustomPolicy`
<a name="iam_GetContextKeysForCustomPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMContextKeysForCustomPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil semua kunci konteks yang ada dalam kebijakan yang disediakan JSON.Untuk memberikan beberapa kebijakan yang dapat Anda berikan sebagai daftar nilai yang dipisahkan koma.**  

```
$policy1 = '{"Version":"2012-10-17",		 	 	 "Statement":{"Effect":"Allow","Action":"dynamodb:*","Resource":"arn:aws:dynamodb:us-west-2:123456789012:table/","Condition":{"DateGreaterThan":{"aws:CurrentTime":"2015-08-16T12:00:00Z"}}}}'
$policy2 = '{"Version":"2012-10-17",		 	 	 "Statement":{"Effect":"Allow","Action":"dynamodb:*","Resource":"arn:aws:dynamodb:us-west-2:123456789012:table/"}}'
Get-IAMContextKeysForCustomPolicy -PolicyInputList $policy1,$policy2
```
+  Untuk detail API, lihat [GetContextKeysForCustomPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMContextKeysForPrincipalPolicy`
<a name="iam_GetContextKeysForPrincipalPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMContextKeysForPrincipalPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil semua kunci konteks yang ada dalam json kebijakan yang disediakan dan kebijakan yang dilampirkan ke entitas IAM (pengguna/peran, dll.). Untuk - PolicyInputList Anda dapat memberikan beberapa daftar nilai sebagai nilai dipisahkan koma.**  

```
$policy1 = '{"Version":"2012-10-17",		 	 	 "Statement":{"Effect":"Allow","Action":"dynamodb:*","Resource":"arn:aws:dynamodb:us-west-2:123456789012:table/","Condition":{"DateGreaterThan":{"aws:CurrentTime":"2015-08-16T12:00:00Z"}}}}'
$policy2 = '{"Version":"2012-10-17",		 	 	 "Statement":{"Effect":"Allow","Action":"dynamodb:*","Resource":"arn:aws:dynamodb:us-west-2:123456789012:table/"}}'
Get-IAMContextKeysForPrincipalPolicy -PolicyInputList $policy1,$policy2 -PolicySourceArn arn:aws:iam::852640994763:user/TestUser
```
+  Untuk detail API, lihat [GetContextKeysForPrincipalPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMCredentialReport`
<a name="iam_GetCredentialReport_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMCredentialReport`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuka laporan yang dikembalikan dan mengeluarkannya ke pipeline sebagai array baris teks. Baris pertama adalah header dengan nama kolom yang dipisahkan koma. Setiap baris berturut-turut adalah baris detail untuk satu pengguna, dengan setiap bidang dipisahkan dengan koma. Sebelum Anda dapat melihat laporan, Anda harus membuatnya dengan `Request-IAMCredentialReport` cmdlet. Untuk mengambil laporan sebagai string tunggal, gunakan `-Raw` sebagai pengganti. `-AsTextArray` Alias juga `-SplitLines` diterima untuk `-AsTextArray` sakelar. Untuk daftar lengkap kolom dalam output, lihat referensi API layanan. Perhatikan bahwa jika Anda tidak menggunakan `-AsTextArray` atau`-SplitLines`, maka Anda harus mengekstrak teks dari `.Content` properti menggunakan `StreamReader` kelas.NET.**  

```
Request-IAMCredentialReport
```
**Output:**  

```
Description                                                         State
-----------                                                         -----
No report exists. Starting a new report generation task             STARTED
```

```
Get-IAMCredentialReport -AsTextArray
```
**Output:**  

```
      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 root_account,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
```
+  Untuk detail API, lihat [GetCredentialReport](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMEntitiesForPolicy`
<a name="iam_ListEntitiesForPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMEntitiesForPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan daftar grup, peran, dan pengguna IAM yang memiliki kebijakan yang `arn:aws:iam::123456789012:policy/TestPolicy` dilampirkan.**  

```
Get-IAMEntitiesForPolicy -PolicyArn "arn:aws:iam::123456789012:policy/TestPolicy"
```
**Output:**  

```
IsTruncated  : False
Marker       : 
PolicyGroups : {}
PolicyRoles  : {testRole}
PolicyUsers  : {Bob, Theresa}
```
+  Untuk detail API, lihat [ListEntitiesForPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMGroup`
<a name="iam_GetGroup_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMGroup`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan detail tentang grup IAM`Testers`, termasuk kumpulan semua pengguna IAM yang termasuk dalam grup.**  

```
$results = Get-IAMGroup -GroupName "Testers"
$results
```
**Output:**  

```
Group                                     IsTruncated           Marker                Users
-----                                     -----------           ------                -----
Amazon.IdentityManagement.Model.Group     False                                       {Theresa, David}
```

```
$results.Group
```
**Output:**  

```
Arn        : arn:aws:iam::123456789012:group/Testers
CreateDate : 12/10/2014 3:39:11 PM
GroupId    : 3RHNZZGQJ7QHMAEXAMPLE1
GroupName  : Testers
Path       : /
```

```
$results.Users
```
**Output:**  

```
Arn              : arn:aws:iam::123456789012:user/Theresa
CreateDate       : 12/10/2014 3:39:27 PM
PasswordLastUsed : 1/1/0001 12:00:00 AM
Path             : /
UserId           : 4OSVDDJJTF4XEEXAMPLE2
UserName         : Theresa

Arn              : arn:aws:iam::123456789012:user/David
CreateDate       : 12/10/2014 3:39:27 PM
PasswordLastUsed : 3/19/2015 8:44:04 AM
Path             : /
UserId           : Y4FKWQCXTA52QEXAMPLE3
UserName         : David
```
+  Untuk detail API, lihat [GetGroup](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMGroupForUser`
<a name="iam_ListGroupsForUser_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMGroupForUser`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan daftar grup IAM yang `David` dimiliki pengguna IAM.**  

```
Get-IAMGroupForUser -UserName David
```
**Output:**  

```
Arn        : arn:aws:iam::123456789012:group/Administrators
CreateDate : 10/20/2014 10:06:24 AM
GroupId    : 6WCH4TRY3KIHIEXAMPLE1
GroupName  : Administrators
Path       : /
      
Arn        : arn:aws:iam::123456789012:group/Testers
CreateDate : 12/10/2014 3:39:11 PM
GroupId    : RHNZZGQJ7QHMAEXAMPLE2
GroupName  : Testers
Path       : /
      
Arn        : arn:aws:iam::123456789012:group/Developers
CreateDate : 12/10/2014 3:38:55 PM
GroupId    : ZU2EOWMK6WBZOEXAMPLE3
GroupName  : Developers
Path       : /
```
+  Untuk detail API, lihat [ListGroupsForUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMGroupList`
<a name="iam_ListGroups_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMGroupList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan koleksi semua grup IAM didefinisikan dalam saat ini Akun AWS.**  

```
Get-IAMGroupList
```
**Output:**  

```
Arn        : arn:aws:iam::123456789012:group/Administrators
CreateDate : 10/20/2014 10:06:24 AM
GroupId    : 6WCH4TRY3KIHIEXAMPLE1
GroupName  : Administrators
Path       : /

Arn        : arn:aws:iam::123456789012:group/Developers
CreateDate : 12/10/2014 3:38:55 PM
GroupId    : ZU2EOWMK6WBZOEXAMPLE2
GroupName  : Developers
Path       : /

Arn        : arn:aws:iam::123456789012:group/Testers
CreateDate : 12/10/2014 3:39:11 PM
GroupId    : RHNZZGQJ7QHMAEXAMPLE3
GroupName  : Testers
Path       : /
```
+  Untuk detail API, lihat [ListGroups](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMGroupPolicy`
<a name="iam_GetGroupPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMGroupPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan rincian tentang kebijakan inline tertanam yang dinamai `PowerUserAccess-Testers` untuk grup`Testers`. `PolicyDocument`Properti ini dikodekan URL. Ini diterjemahkan dalam contoh ini dengan `UrlDecode` metode.NET.**  

```
$results = Get-IAMGroupPolicy -GroupName Testers -PolicyName PowerUserAccess-Testers
$results
```
**Output:**  

```
GroupName     PolicyDocument                                              PolicyName
---------     --------------                                              ----------
Testers       %7B%0A%20%20%22Version%22%3A%20%222012-10-17%22%2C%0A%20... PowerUserAccess-Testers

[System.Reflection.Assembly]::LoadWithPartialName("System.Web.HttpUtility")
[System.Web.HttpUtility]::UrlDecode($results.PolicyDocument)
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeInstances"
      ],
      "Resource": [
        "arn:aws:ec2:us-east-1:555555555555:instance/i-b188560f"
      ]
    }
  ]
}
```
+  Untuk detail API, lihat [GetGroupPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMGroupPolicyList`
<a name="iam_ListGroupPolicies_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMGroupPolicyList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan daftar kebijakan inline yang disematkan dalam grup`Testers`. Untuk mendapatkan kebijakan terkelola yang dilampirkan ke grup, gunakan perintah`Get-IAMAttachedGroupPolicyList`.**  

```
Get-IAMGroupPolicyList -GroupName Testers
```
**Output:**  

```
Deny-Assume-S3-Role-In-Production
PowerUserAccess-Testers
```
+  Untuk detail API, lihat [ListGroupPolicies](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMInstanceProfile`
<a name="iam_GetInstanceProfile_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMInstanceProfile`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan rincian profil contoh bernama `ec2instancerole` yang didefinisikan dalam AWS akun saat ini.**  

```
Get-IAMInstanceProfile -InstanceProfileName ec2instancerole
```
**Output:**  

```
Arn                 : arn:aws:iam::123456789012:instance-profile/ec2instancerole
CreateDate          : 2/17/2015 2:49:04 PM
InstanceProfileId   : HH36PTZQJUR32EXAMPLE1
InstanceProfileName : ec2instancerole
Path                : /
Roles               : {ec2instancerole}
```
+  Untuk detail API, lihat [GetInstanceProfile](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMInstanceProfileForRole`
<a name="iam_ListInstanceProfilesForRole_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMInstanceProfileForRole`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan rincian profil instance yang terkait dengan peran`ec2instancerole`.**  

```
Get-IAMInstanceProfileForRole -RoleName ec2instancerole
```
**Output:**  

```
      Arn                 : arn:aws:iam::123456789012:instance-profile/ec2instancerole
      CreateDate          : 2/17/2015 2:49:04 PM
      InstanceProfileId   : HH36PTZQJUR32EXAMPLE1
      InstanceProfileName : ec2instancerole
      Path                : /
      Roles               : {ec2instancerole}
```
+  Untuk detail API, lihat [ListInstanceProfilesForRole](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMInstanceProfileList`
<a name="iam_ListInstanceProfiles_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMInstanceProfileList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan koleksi profil instance didefinisikan dalam saat ini Akun AWS.**  

```
Get-IAMInstanceProfileList
```
**Output:**  

```
Arn                 : arn:aws:iam::123456789012:instance-profile/ec2instancerole
CreateDate          : 2/17/2015 2:49:04 PM
InstanceProfileId   : HH36PTZQJUR32EXAMPLE1
InstanceProfileName : ec2instancerole
Path                : /
Roles               : {ec2instancerole}
```
+  Untuk detail API, lihat [ListInstanceProfiles](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMLoginProfile`
<a name="iam_GetLoginProfile_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMLoginProfile`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan tanggal pembuatan kata sandi dan apakah reset kata sandi diperlukan untuk pengguna `David` IAM.**  

```
Get-IAMLoginProfile -UserName David
```
**Output:**  

```
CreateDate                   PasswordResetRequired                 UserName
----------                   ---------------------                 --------
12/10/2014 3:39:44 PM        False                                 David
```
+  Untuk detail API, lihat [GetLoginProfile](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMMFADevice`
<a name="iam_ListMfaDevices_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMMFADevice`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan rincian tentang perangkat MFA yang ditetapkan untuk pengguna IAM. `David` Dalam contoh ini Anda dapat mengatakan bahwa itu adalah perangkat virtual karena `SerialNumber` adalah ARN bukan nomor seri aktual perangkat fisik.**  

```
Get-IAMMFADevice -UserName David
```
**Output:**  

```
EnableDate                  SerialNumber                           UserName
----------                  ------------                           --------
4/8/2015 9:41:10 AM         arn:aws:iam::123456789012:mfa/David    David
```
+  Untuk detail API, lihat [ListMfaDevices](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMOpenIDConnectProvider`
<a name="iam_GetOpenIdConnectProvider_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMOpenIDConnectProvider`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan rincian tentang penyedia OpenID Connect yang ARN adalah. `arn:aws:iam::123456789012:oidc-provider/accounts.google.com` `ClientIDList`Properti adalah koleksi yang berisi semua Klien yang IDs ditentukan untuk penyedia ini.**  

```
Get-IAMOpenIDConnectProvider -OpenIDConnectProviderArn arn:aws:iam::123456789012:oidc-provider/oidc.example.com
```
**Output:**  

```
ClientIDList         CreateDate                ThumbprintList                               Url
------------         ----------                --------------                               ---
{MyOIDCApp}          2/3/2015 3:00:30 PM       {12345abcdefghijk67890lmnopqrst98765uvwxy}   oidc.example.com
```
+  Untuk detail API, lihat [GetOpenIdConnectProvider](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMOpenIDConnectProviderList`
<a name="iam_ListOpenIdConnectProviders_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMOpenIDConnectProviderList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan daftar ARNS dari semua penyedia OpenID Connect yang didefinisikan dalam Akun AWS saat ini.**  

```
Get-IAMOpenIDConnectProviderList
```
**Output:**  

```
Arn
---
arn:aws:iam::123456789012:oidc-provider/server.example.com
arn:aws:iam::123456789012:oidc-provider/another.provider.com
```
+  Untuk detail API, lihat [ListOpenIdConnectProviders](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMPolicy`
<a name="iam_GetPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan rincian tentang kebijakan terkelola yang ARN. `arn:aws:iam::123456789012:policy/MySamplePolicy`**  

```
Get-IAMPolicy -PolicyArn arn:aws:iam::123456789012:policy/MySamplePolicy
```
**Output:**  

```
Arn              : arn:aws:iam::aws:policy/MySamplePolicy
AttachmentCount  : 0
CreateDate       : 2/6/2015 10:40:08 AM
DefaultVersionId : v1
Description      : 
IsAttachable     : True
Path             : /
PolicyId         : Z27SI6FQMGNQ2EXAMPLE1
PolicyName       : MySamplePolicy
UpdateDate       : 2/6/2015 10:40:08 AM
```
+  Untuk detail API, lihat [GetPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMPolicyList`
<a name="iam_ListPolicies_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMPolicyList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan kumpulan dari tiga kebijakan terkelola pertama yang tersedia di AWS akun saat ini. Karena tidak `-scope` ditentukan, defaultnya `all` dan mencakup kebijakan terkelola dan yang AWS dikelola pelanggan.**  

```
Get-IAMPolicyList -MaxItem 3
```
**Output:**  

```
Arn              : arn:aws:iam::aws:policy/AWSDirectConnectReadOnlyAccess
AttachmentCount  : 0
CreateDate       : 2/6/2015 10:40:08 AM
DefaultVersionId : v1
Description      : 
IsAttachable     : True
Path             : /
PolicyId         : Z27SI6FQMGNQ2EXAMPLE1
PolicyName       : AWSDirectConnectReadOnlyAccess
UpdateDate       : 2/6/2015 10:40:08 AM
      
Arn              : arn:aws:iam::aws:policy/AmazonGlacierReadOnlyAccess
AttachmentCount  : 0
CreateDate       : 2/6/2015 10:40:27 AM
DefaultVersionId : v1
Description      : 
IsAttachable     : True
Path             : /
PolicyId         : NJKMU274MET4EEXAMPLE2
PolicyName       : AmazonGlacierReadOnlyAccess
UpdateDate       : 2/6/2015 10:40:27 AM
      
Arn              : arn:aws:iam::aws:policy/AWSMarketplaceFullAccess
AttachmentCount  : 0
CreateDate       : 2/11/2015 9:21:45 AM
DefaultVersionId : v1
Description      : 
IsAttachable     : True
Path             : /
PolicyId         : 5ULJSO2FYVPYGEXAMPLE3
PolicyName       : AWSMarketplaceFullAccess
UpdateDate       : 2/11/2015 9:21:45 AM
```
**Contoh 2: Contoh ini mengembalikan kumpulan dari dua kebijakan terkelola pelanggan pertama yang tersedia di AWS akun saat ini. Ini digunakan `-Scope local` untuk membatasi output hanya pada kebijakan yang dikelola pelanggan.**  

```
Get-IAMPolicyList -Scope local -MaxItem 2
```
**Output:**  

```
Arn              : arn:aws:iam::123456789012:policy/MyLocalPolicy
AttachmentCount  : 0
CreateDate       : 2/12/2015 9:39:09 AM
DefaultVersionId : v2
Description      : 
IsAttachable     : True
Path             : /
PolicyId         : SQVCBLC4VAOUCEXAMPLE4
PolicyName       : MyLocalPolicy
UpdateDate       : 2/12/2015 9:39:53 AM

Arn              : arn:aws:iam::123456789012:policy/policyforec2instancerole
AttachmentCount  : 1
CreateDate       : 2/17/2015 2:51:38 PM
DefaultVersionId : v11
Description      : 
IsAttachable     : True
Path             : /
PolicyId         : X5JPBLJH2Z2SOEXAMPLE5
PolicyName       : policyforec2instancerole
UpdateDate       : 2/18/2015 8:52:31 AM
```
+  Untuk detail API, lihat [ListPolicies](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMPolicyVersion`
<a name="iam_GetPolicyVersion_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMPolicyVersion`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan dokumen kebijakan untuk `v2` versi kebijakan yang ARN-nya. `arn:aws:iam::123456789012:policy/MyManagedPolicy` Dokumen kebijakan dalam `Document` properti adalah URL yang dikodekan dan diterjemahkan dalam contoh ini dengan metode.NET. `UrlDecode`**  

```
$results = Get-IAMPolicyVersion -PolicyArn arn:aws:iam::123456789012:policy/MyManagedPolicy -VersionId v2
$results
```
**Output:**  

```
CreateDate             Document                                        IsDefaultVersion     VersionId
----------             --------                                        ----------------     ---------
2/12/2015 9:39:53 AM   %7B%0A%20%20%22Version%22%3A%20%222012-10...    True                 v2

[System.Reflection.Assembly]::LoadWithPartialName("System.Web.HttpUtility")
$policy = [System.Web.HttpUtility]::UrlDecode($results.Document)
$policy
{
  "Version":"2012-10-17",		 	 	 
  "Statement": 
    {
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeInstances"
      ],
      "Resource": [
        "arn:aws:ec2:us-east-1:555555555555:instance/i-b188560f"
      ]
    }
}
```
+  Untuk detail API, lihat [GetPolicyVersion](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMPolicyVersionList`
<a name="iam_ListPolicyVersions_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMPolicyVersionList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan daftar versi kebijakan yang tersedia yang ARN-nya. `arn:aws:iam::123456789012:policy/MyManagedPolicy` Untuk mendapatkan dokumen kebijakan untuk versi tertentu, gunakan `Get-IAMPolicyVersion` perintah dan tentukan `VersionId` yang Anda inginkan.**  

```
Get-IAMPolicyVersionList -PolicyArn arn:aws:iam::123456789012:policy/MyManagedPolicy
```
**Output:**  

```
CreateDate                   Document                 IsDefaultVersion                  VersionId
----------                   --------                 ----------------                  ---------
2/12/2015 9:39:53 AM                                  True                              v2
2/12/2015 9:39:09 AM                                  False                             v1
```
+  Untuk detail API, lihat [ListPolicyVersions](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMRole`
<a name="iam_GetRole_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMRole`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan rincian`lamda_exec_role`. Ini termasuk dokumen kebijakan kepercayaan yang menentukan siapa yang dapat mengambil peran ini. Dokumen kebijakan adalah URL yang dikodekan dan dapat diterjemahkan menggunakan metode.NET. `UrlDecode` Dalam contoh ini, kebijakan asli menghapus semua spasi putih sebelum diunggah ke kebijakan. Untuk melihat dokumen kebijakan izin yang menentukan apa yang dapat dilakukan oleh seseorang yang mengasumsikan peran tersebut, gunakan kebijakan `Get-IAMRolePolicy` for inline, dan `Get-IAMPolicyVersion` untuk kebijakan terkelola terlampir.**  

```
$results = Get-IamRole -RoleName lambda_exec_role
$results | Format-List
```
**Output:**  

```
Arn                      : arn:aws:iam::123456789012:role/lambda_exec_role
AssumeRolePolicyDocument : %7B%22Version%22%3A%222012-10-17%22%2C%22Statement%22%3A%5B%7B%22Sid%22
                           %3A%22%22%2C%22Effect%22%3A%22Allow%22%2C%22Principal%22%3A%7B%22Service
                           %22%3A%22lambda.amazonaws.com%22%7D%2C%22Action%22%3A%22sts%3AAssumeRole
                           %22%7D%5D%7D
CreateDate               : 4/2/2015 9:16:11 AM
Path                     : /
RoleId                   : 2YBIKAIBHNKB4EXAMPLE1
RoleName                 : lambda_exec_role
```

```
$policy = [System.Web.HttpUtility]::UrlDecode($results.AssumeRolePolicyDocument)
$policy
```
**Output:**  

```
{"Version":"2012-10-17",		 	 	 "Statement":[{"Sid":"","Effect":"Allow","Principal":{"Service":"lambda.amazonaws.com"},"Action":"sts:AssumeRole"}]}
```
+  Untuk detail API, lihat [GetRole](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMRoleList`
<a name="iam_ListRoles_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMRoleList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil daftar semua peran IAM di. Akun AWS**  

```
Get-IAMRoleList
```
+  Untuk detail API, lihat [ListRoles](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMRolePolicy`
<a name="iam_GetRolePolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMRolePolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan dokumen kebijakan izin untuk kebijakan bernama `oneClick_lambda_exec_role_policy` yang disematkan dalam peran IAM. `lamda_exec_role` Dokumen kebijakan yang dihasilkan adalah URL yang dikodekan. Ini diterjemahkan dalam contoh ini dengan `UrlDecode` metode.NET.**  

```
$results = Get-IAMRolePolicy -RoleName lambda_exec_role -PolicyName oneClick_lambda_exec_role_policy
$results
```
**Output:**  

```
PolicyDocument                                            PolicyName                           UserName
--------------                                            ----------                           --------
%7B%0A%20%20%22Version%22%3A%20%222012-10-17%22%2C%...    oneClick_lambda_exec_role_policy     lambda_exec_role
```

```
[System.Reflection.Assembly]::LoadWithPartialName("System.Web.HttpUtility")
[System.Web.HttpUtility]::UrlDecode($results.PolicyDocument)
```
**Output:**  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "logs:*"
      ],
      "Resource": "arn:aws:logs:us-east-1:555555555555:log-group:/aws/lambda/aws-example-function:*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject"
      ],
      "Resource": [
        "arn:aws:s3:::amzn-s3-demo-bucket/*"
      ]
    }
  ]
}
```
+  Untuk detail API, lihat [GetRolePolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMRolePolicyList`
<a name="iam_ListRolePolicies_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMRolePolicyList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan daftar nama kebijakan inline yang disematkan dalam peran IAM. `lamda_exec_role` Untuk melihat detail kebijakan inline, gunakan perintah`Get-IAMRolePolicy`.**  

```
Get-IAMRolePolicyList -RoleName lambda_exec_role
```
**Output:**  

```
oneClick_lambda_exec_role_policy
```
+  Untuk detail API, lihat [ListRolePolicies](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMRoleTagList`
<a name="iam_ListRoleTags_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMRoleTagList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil tag yang terkait dengan peran..**  

```
Get-IAMRoleTagList -RoleName MyRoleName
```
+  Untuk detail API, lihat [ListRoleTags](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMSAMLProvider`
<a name="iam_GetSamlProvider_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMSAMLProvider`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil detail tentang penyedia SAMP 2.0 yang ARM adalah arn:aws:iam: :123456789012: Saml-provider/Samladfs. Responsnya mencakup dokumen metadata yang Anda dapatkan dari penyedia identitas untuk membuat entitas penyedia AWS SAMP serta tanggal pembuatan dan kedaluwarsa.**  

```
Get-IAMSAMLProvider -SAMLProviderArn arn:aws:iam::123456789012:saml-provider/SAMLADFS
```
**Output:**  

```
CreateDate                 SAMLMetadataDocument                                          ValidUntil
----------                 --------------------                                          ----------
12/23/2014 12:16:55 PM    <EntityDescriptor ID="_12345678-1234-5678-9012-example1...    12/23/2114 12:16:54 PM
```
+  Untuk detail API, lihat [GetSamlProvider](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMSAMLProviderList`
<a name="iam_ListSAMLProviders_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMSAMLProviderList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil daftar penyedia SAMP 2.0 yang dibuat saat ini. Akun AWS Ini mengembalikan ARN, tanggal pembuatan, dan tanggal kedaluwarsa untuk setiap penyedia SAFL.**  

```
Get-IAMSAMLProviderList
```
**Output:**  

```
Arn                                                 CreateDate                      ValidUntil
---                                                 ----------                      ----------
arn:aws:iam::123456789012:saml-provider/SAMLADFS    12/23/2014 12:16:55 PM          12/23/2114 12:16:54 PM
```
+  Untuk detail API, lihat [Daftar SAMLProviders](https://docs.aws.amazon.com/powershell/v5/reference) di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMServerCertificate`
<a name="iam_GetServerCertificate_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMServerCertificate`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil rincian tentang sertifikat server bernama`MyServerCertificate`. Anda dapat menemukan rincian sertifikat di `CertificateBody` dan `ServerCertificateMetadata` properti.**  

```
$result = Get-IAMServerCertificate -ServerCertificateName MyServerCertificate
$result | format-list
```
**Output:**  

```
CertificateBody           : -----BEGIN CERTIFICATE-----
                            MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC
                            VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6
                            b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd
                            BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN
                            MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD
                            VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z
                            b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt
                            YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ
                            21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T
                            rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE
                            Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4
                            nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb
                            FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb
                            NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE=
                            -----END CERTIFICATE-----
CertificateChain          : 
ServerCertificateMetadata : Amazon.IdentityManagement.Model.ServerCertificateMetadata
```

```
$result.ServerCertificateMetadata
```
**Output:**  

```
Arn                   : arn:aws:iam::123456789012:server-certificate/Org1/Org2/MyServerCertificate
Expiration            : 1/14/2018 9:52:36 AM
Path                  : /Org1/Org2/
ServerCertificateId   : ASCAJIFEXAMPLE17HQZYW
ServerCertificateName : MyServerCertificate
UploadDate            : 4/21/2015 11:14:16 AM
```
+  Untuk detail API, lihat [GetServerCertificate](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMServerCertificateList`
<a name="iam_ListServerCertificates_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMServerCertificateList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil daftar sertifikat server yang telah diunggah ke saat ini. Akun AWS**  

```
Get-IAMServerCertificateList
```
**Output:**  

```
Arn                   : arn:aws:iam::123456789012:server-certificate/Org1/Org2/MyServerCertificate
Expiration            : 1/14/2018 9:52:36 AM
Path                  : /Org1/Org2/
ServerCertificateId   : ASCAJIFEXAMPLE17HQZYW
ServerCertificateName : MyServerCertificate
UploadDate            : 4/21/2015 11:14:16 AM
```
+  Untuk detail API, lihat [ListServerCertificates](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMServiceLastAccessedDetail`
<a name="iam_GetServiceLastAccessedDetails_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMServiceLastAccessedDetail`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memberikan rincian layanan yang terakhir diakses oleh entitas IAM (pengguna, grup, peran, atau kebijakan) yang terkait dalam panggilan Permintaan.**  

```
Request-IAMServiceLastAccessedDetail -Arn arn:aws:iam::123456789012:user/TestUser
```
**Output:**  

```
f0b7a819-eab0-929b-dc26-ca598911cb9f
```

```
Get-IAMServiceLastAccessedDetail -JobId f0b7a819-eab0-929b-dc26-ca598911cb9f
```
+  Untuk detail API, lihat [GetServiceLastAccessedDetails](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMServiceLastAccessedDetailWithEntity`
<a name="iam_GetServiceLastAccessedDetailsWithEntities_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMServiceLastAccessedDetailWithEntity`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memberikan stempel waktu terakhir yang diakses untuk layanan dalam permintaan oleh entitas IAM masing-masing.**  

```
$results = Get-IAMServiceLastAccessedDetailWithEntity -JobId f0b7a819-eab0-929b-dc26-ca598911cb9f -ServiceNamespace ec2
$results
```
**Output:**  

```
EntityDetailsList : {Amazon.IdentityManagement.Model.EntityDetails}
Error             : 
IsTruncated       : False
JobCompletionDate : 12/29/19 11:19:31 AM
JobCreationDate   : 12/29/19 11:19:31 AM
JobStatus         : COMPLETED
Marker            :
```

```
$results.EntityDetailsList
```
**Output:**  

```
EntityInfo                                 LastAuthenticated
----------                                 -----------------
Amazon.IdentityManagement.Model.EntityInfo 11/16/19 3:47:00 PM
```

```
$results.EntityInfo
```
**Output:**  

```
Arn  : arn:aws:iam::123456789012:user/TestUser
Id   : AIDA4NBK5CXF5TZHU1234
Name : TestUser
Path : /
Type : USER
```
+  Untuk detail API, lihat [GetServiceLastAccessedDetailsWithEntities](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMSigningCertificate`
<a name="iam_ListSigningCertificates_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMSigningCertificate`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil rincian tentang sertifikat penandatanganan yang terkait dengan nama `Bob` pengguna.**  

```
Get-IAMSigningCertificate -UserName Bob
```
**Output:**  

```
CertificateBody : -----BEGIN CERTIFICATE-----
                  MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC
                  VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6
                  b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd
                  BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN
                  MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD
                  VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z
                  b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt
                  YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ
                  21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T
                  rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE
                  Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4
                  nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb
                  FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb
                  NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE=
                  -----END CERTIFICATE-----
CertificateId   : Y3EK7RMEXAMPLESV33FCREXAMPLEMJLU
Status          : Active
UploadDate      : 4/20/2015 1:26:01 PM
UserName        : Bob
```
+  Untuk detail API, lihat [ListSigningCertificates](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMUser`
<a name="iam_GetUser_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMUser`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil rincian tentang nama `David` pengguna.**  

```
Get-IAMUser -UserName David
```
**Output:**  

```
Arn              : arn:aws:iam::123456789012:user/David
CreateDate       : 12/10/2014 3:39:27 PM
PasswordLastUsed : 3/19/2015 8:44:04 AM
Path             : /
UserId           : Y4FKWQCXTA52QEXAMPLE1
UserName         : David
```
**Contoh 2: Contoh ini mengambil detail tentang pengguna IAM yang saat ini masuk.**  

```
Get-IAMUser
```
**Output:**  

```
Arn              : arn:aws:iam::123456789012:user/Bob
CreateDate       : 10/16/2014 9:03:09 AM
PasswordLastUsed : 3/4/2015 12:12:33 PM
Path             : /
UserId           : 7K3GJEANSKZF2EXAMPLE2
UserName         : Bob
```
+  Untuk detail API, lihat [GetUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMUserList`
<a name="iam_ListUsers_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMUserList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil koleksi pengguna saat ini Akun AWS.**  

```
Get-IAMUserList
```
**Output:**  

```
      Arn              : arn:aws:iam::123456789012:user/Administrator
      CreateDate       : 10/16/2014 9:03:09 AM
      PasswordLastUsed : 3/4/2015 12:12:33 PM
      Path             : /
      UserId           : 7K3GJEANSKZF2EXAMPLE1
      UserName         : Administrator
      
      Arn              : arn:aws:iam::123456789012:user/Bob
      CreateDate       : 4/6/2015 12:54:42 PM
      PasswordLastUsed : 1/1/0001 12:00:00 AM
      Path             : /
      UserId           : L3EWNONDOM3YUEXAMPLE2
      UserName         : bab
      
      Arn              : arn:aws:iam::123456789012:user/David
      CreateDate       : 12/10/2014 3:39:27 PM
      PasswordLastUsed : 3/19/2015 8:44:04 AM
      Path             : /
      UserId           : Y4FKWQCXTA52QEXAMPLE3
      UserName         : David
```
+  Untuk detail API, lihat [ListUsers](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMUserPolicy`
<a name="iam_GetUserPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMUserPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil rincian kebijakan inline bernama `Davids_IAM_Admin_Policy` yang disematkan dalam nama pengguna IAM. `David` Dokumen kebijakan adalah URL yang dikodekan.**  

```
$results = Get-IAMUserPolicy -PolicyName Davids_IAM_Admin_Policy -UserName David
$results
```
**Output:**  

```
PolicyDocument                                            PolicyName                    UserName
--------------                                            ----------                    --------
%7B%0A%20%20%22Version%22%3A%20%222012-10-17%22%2C%...    Davids_IAM_Admin_Policy       David

[System.Reflection.Assembly]::LoadWithPartialName("System.Web.HttpUtility")
[System.Web.HttpUtility]::UrlDecode($results.PolicyDocument)
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "iam:GetUser",
        "iam:ListUsers"
      ],
      "Resource": [
        "arn:aws:iam::111122223333:user/*"
      ]
    }
  ]
}
```
+  Untuk detail API, lihat [GetUserPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMUserPolicyList`
<a name="iam_ListUserPolicies_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMUserPolicyList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil daftar nama kebijakan inline yang disematkan dalam nama pengguna IAM. `David`**  

```
Get-IAMUserPolicyList -UserName David
```
**Output:**  

```
Davids_IAM_Admin_Policy
```
+  Untuk detail API, lihat [ListUserPolicies](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMUserTagList`
<a name="iam_ListUserTags_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMUserTagList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil tag yang terkait dengan pengguna.**  

```
Get-IAMUserTagList -UserName joe
```
+  Untuk detail API, lihat [ListUserTags](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-IAMVirtualMFADevice`
<a name="iam_ListVirtualMfaDevices_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Get-IAMVirtualMFADevice`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengambil koleksi perangkat MFA virtual yang ditetapkan untuk pengguna di AWS akun. `User`Properti masing-masing adalah objek dengan detail pengguna IAM tempat perangkat ditugaskan.**  

```
Get-IAMVirtualMFADevice -AssignmentStatus Assigned
```
**Output:**  

```
Base32StringSeed : 
EnableDate       : 4/13/2015 12:03:42 PM
QRCodePNG        : 
SerialNumber     : arn:aws:iam::123456789012:mfa/David
User             : Amazon.IdentityManagement.Model.User

Base32StringSeed : 
EnableDate       : 4/13/2015 12:06:41 PM
QRCodePNG        : 
SerialNumber     : arn:aws:iam::123456789012:mfa/root-account-mfa-device
User             : Amazon.IdentityManagement.Model.User
```
+  Untuk detail API, lihat [ListVirtualMfaDevices](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMAccessKey`
<a name="iam_CreateAccessKey_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMAccessKey`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat kunci akses baru dan secret access key pair dan menetapkannya ke pengguna`David`. Pastikan Anda menyimpan `AccessKeyId` dan `SecretAccessKey` nilai ke file karena ini adalah satu-satunya waktu Anda dapat memperoleh file`SecretAccessKey`. Anda tidak dapat mengambilnya di lain waktu. Jika Anda kehilangan kunci rahasia, Anda harus membuat access key pair baru.**  

```
New-IAMAccessKey -UserName David
```
**Output:**  

```
AccessKeyId     : AKIAIOSFODNN7EXAMPLE
CreateDate      : 4/13/2015 1:00:42 PM
SecretAccessKey : wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Status          : Active
UserName        : David
```
+  Untuk detail API, lihat [CreateAccessKey](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMAccountAlias`
<a name="iam_CreateAccountAlias_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMAccountAlias`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengubah alias akun untuk AWS `mycompanyaws` akun Anda. Alamat halaman logon pengguna diarahkan ke panyaws.signin.aws.amazon.com/console. https://mycom URL asli menggunakan nomor ID akun Anda, bukan alias (https://<accountidnumber>.signin.aws.amazon.com/console) terus berfungsi. Namun, semua berbasis alias yang didefinisikan sebelumnya URLs berhenti bekerja.**  

```
New-IAMAccountAlias -AccountAlias mycompanyaws
```
+  Untuk detail API, lihat [CreateAccountAlias](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMGroup`
<a name="iam_CreateGroup_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMGroup`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat grup IAM baru bernama`Developers`.**  

```
New-IAMGroup -GroupName Developers
```
**Output:**  

```
Arn        : arn:aws:iam::123456789012:group/Developers
CreateDate : 4/14/2015 11:21:31 AM
GroupId    : QNEJ5PM4NFSQCEXAMPLE1
GroupName  : Developers
Path       : /
```
+  Untuk detail API, lihat [CreateGroup](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMInstanceProfile`
<a name="iam_CreateInstanceProfile_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMInstanceProfile`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat profil instans IAM baru bernama`ProfileForDevEC2Instance`. Anda harus menjalankan `Add-IAMRoleToInstanceProfile` perintah secara terpisah untuk mengaitkan profil instance dengan peran IAM yang ada yang memberikan izin ke instance. Terakhir, lampirkan profil instance ke EC2 instance saat Anda meluncurkannya. Untuk melakukan itu, gunakan `New-EC2Instance` cmdlet dengan parameter `InstanceProfile_Arn` or`InstanceProfile_Name`.**  

```
New-IAMInstanceProfile -InstanceProfileName ProfileForDevEC2Instance
```
**Output:**  

```
Arn                 : arn:aws:iam::123456789012:instance-profile/ProfileForDevEC2Instance
CreateDate          : 4/14/2015 11:31:39 AM
InstanceProfileId   : DYMFXL556EY46EXAMPLE1
InstanceProfileName : ProfileForDevEC2Instance
Path                : /
Roles               : {}
```
+  Untuk detail API, lihat [CreateInstanceProfile](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMLoginProfile`
<a name="iam_CreateLoginProfile_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMLoginProfile`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat kata sandi (sementara) untuk pengguna IAM bernama Bob, dan menetapkan tanda yang mengharuskan pengguna untuk mengubah kata sandi saat `Bob` masuk berikutnya.**  

```
New-IAMLoginProfile -UserName Bob -Password P@ssw0rd -PasswordResetRequired $true
```
**Output:**  

```
CreateDate                    PasswordResetRequired                UserName
----------                    ---------------------                --------
4/14/2015 12:26:30 PM         True                                 Bob
```
+  Untuk detail API, lihat [CreateLoginProfile](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMOpenIDConnectProvider`
<a name="iam_CreateOpenIdConnectProvider_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMOpenIDConnectProvider`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat penyedia IAM OIDC yang terkait dengan layanan penyedia kompatibel OIDC yang ditemukan di URL `https://example.oidcprovider.com` dan ID klien. `my-testapp-1` Penyedia OIDC memasok sidik jari. Untuk mengautentikasi sidik jari, ikuti langkah-langkah di http://docs.aws.amazon. com/IAM/latest/UserGuide/identity- providers-oidc-obtain-thumbprint .html**.  

```
New-IAMOpenIDConnectProvider -Url https://example.oidcprovider.com -ClientIDList my-testapp-1 -ThumbprintList 990F419EXAMPLEECF12DDEDA5EXAMPLE52F20D9E
```
**Output:**  

```
arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com
```
+  Untuk detail API, lihat [CreateOpenIdConnectProvider](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMPolicy`
<a name="iam_CreatePolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat kebijakan IAM baru di AWS akun saat ini bernama `MySamplePolicy` File `MySamplePolicy.json` menyediakan konten kebijakan. Perhatikan bahwa Anda harus menggunakan parameter `-Raw` switch untuk berhasil memproses file kebijakan JSON.**  

```
New-IAMPolicy -PolicyName MySamplePolicy -PolicyDocument (Get-Content -Raw MySamplePolicy.json)
```
**Output:**  

```
Arn              : arn:aws:iam::123456789012:policy/MySamplePolicy
AttachmentCount  : 0
CreateDate       : 4/14/2015 2:45:59 PM
DefaultVersionId : v1
Description      : 
IsAttachable     : True
Path             : /
PolicyId         : LD4KP6HVFE7WGEXAMPLE1
PolicyName       : MySamplePolicy
UpdateDate       : 4/14/2015 2:45:59 PM
```
+  Untuk detail API, lihat [CreatePolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMPolicyVersion`
<a name="iam_CreatePolicyVersion_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMPolicyVersion`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat versi “v2" baru dari kebijakan IAM yang ARN-nya `arn:aws:iam::123456789012:policy/MyPolicy` dan menjadikannya versi default. `NewPolicyVersion.json`File tersebut menyediakan konten kebijakan. Perhatikan bahwa Anda harus menggunakan parameter `-Raw` switch untuk berhasil memproses file kebijakan JSON.**  

```
New-IAMPolicyVersion -PolicyArn arn:aws:iam::123456789012:policy/MyPolicy -PolicyDocument (Get-content -Raw NewPolicyVersion.json) -SetAsDefault $true
```
**Output:**  

```
CreateDate                           Document                  IsDefaultVersion             VersionId
----------                           --------                  ----------------             ---------
4/15/2015 10:54:54 AM                                          True                         v2
```
+  Untuk detail API, lihat [CreatePolicyVersion](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMRole`
<a name="iam_CreateRole_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMRole`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat peran baru bernama `MyNewRole` dan melampirkan padanya kebijakan yang ditemukan dalam file`NewRoleTrustPolicy.json`. Perhatikan bahwa Anda harus menggunakan parameter `-Raw` switch untuk berhasil memproses file kebijakan JSON. Dokumen kebijakan yang ditampilkan dalam output adalah URL yang dikodekan. Ini diterjemahkan dalam contoh ini dengan `UrlDecode` metode.NET.**  

```
$results = New-IAMRole -AssumeRolePolicyDocument (Get-Content -raw NewRoleTrustPolicy.json) -RoleName MyNewRole
$results
```
**Output:**  

```
Arn                      : arn:aws:iam::123456789012:role/MyNewRole
AssumeRolePolicyDocument : %7B%0D%0A%20%20%22Version%22%3A%20%222012-10-17%22%2C%0D%0A%20%20%22Statement%22
                           %3A%20%5B%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22Sid%22%3A%20%22%22%2C
                           %0D%0A%20%20%20%20%20%20%22Effect%22%3A%20%22Allow%22%2C%0D%0A%20%20%20%20%20%20
                           %22Principal%22%3A%20%7B%0D%0A%20%20%20%20%20%20%20%20%22AWS%22%3A%20%22arn%3Aaws
                           %3Aiam%3A%3A123456789012%3ADavid%22%0D%0A%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20
                           %20%20%20%22Action%22%3A%20%22sts%3AAssumeRole%22%0D%0A%20%20%20%20%7D%0D%0A%20
                           %20%5D%0D%0A%7D
CreateDate               : 4/15/2015 11:04:23 AM
Path                     : /
RoleId                   : V5PAJI2KPN4EAEXAMPLE1
RoleName                 : MyNewRole

[System.Reflection.Assembly]::LoadWithPartialName("System.Web.HttpUtility")
[System.Web.HttpUtility]::UrlDecode($results.AssumeRolePolicyDocument)
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::123456789012:David"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
```
+  Untuk detail API, lihat [CreateRole](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMSAMLProvider`
<a name="iam_CreateSAMLProvider_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMSAMLProvider`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat entitas penyedia SAMP baru di IAM. Ini dinamai `MySAMLProvider` dan dijelaskan oleh dokumen metadata SAMP yang ditemukan dalam file`SAMLMetaData.xml`, yang diunduh secara terpisah dari situs web penyedia layanan SAMP.**  

```
New-IAMSAMLProvider -Name MySAMLProvider -SAMLMetadataDocument (Get-Content -Raw SAMLMetaData.xml)
```
**Output:**  

```
arn:aws:iam::123456789012:saml-provider/MySAMLProvider
```
+  Untuk detail API, lihat [Membuat SAMLProvider](https://docs.aws.amazon.com/powershell/v5/reference) di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMServiceLinkedRole`
<a name="iam_CreateServiceLinkedRole_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMServiceLinkedRole`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat peran servicelinked untuk layanan penskalaan otomatis.**  

```
New-IAMServiceLinkedRole -AWSServiceName autoscaling.amazonaws.com -CustomSuffix RoleNameEndsWithThis -Description "My service-linked role to support autoscaling"
```
+  Untuk detail API, lihat [CreateServiceLinkedRole](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMUser`
<a name="iam_CreateUser_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMUser`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat pengguna IAM bernama`Bob`. Jika Bob perlu masuk ke AWS konsol, maka Anda harus menjalankan perintah secara terpisah `New-IAMLoginProfile` untuk membuat profil masuk dengan kata sandi. Jika Bob perlu menjalankan AWS PowerShell atau perintah CLI lintas platform atau AWS melakukan panggilan API, maka Anda harus menjalankan `New-IAMAccessKey` perintah secara terpisah untuk membuat kunci akses.**  

```
New-IAMUser -UserName Bob
```
**Output:**  

```
Arn              : arn:aws:iam::123456789012:user/Bob
CreateDate       : 4/22/2015 12:02:11 PM
PasswordLastUsed : 1/1/0001 12:00:00 AM
Path             : /
UserId           : AIDAJWGEFDMEMEXAMPLE1
UserName         : Bob
```
+  Untuk detail API, lihat [CreateUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-IAMVirtualMFADevice`
<a name="iam_CreateVirtualMfaDevice_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`New-IAMVirtualMFADevice`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat perangkat MFA virtual baru. Baris 2 dan 3 mengekstrak `Base32StringSeed` nilai yang dibutuhkan program perangkat lunak MFA virtual untuk membuat akun (sebagai alternatif dari kode QR). Setelah Anda mengkonfigurasi program dengan nilai, dapatkan dua kode otentikasi berurutan dari program. Terakhir, gunakan perintah terakhir untuk menautkan perangkat MFA virtual ke pengguna IAM `Bob` dan menyinkronkan akun dengan dua kode otentikasi.**  

```
$Device = New-IAMVirtualMFADevice -VirtualMFADeviceName BobsMFADevice
$SR = New-Object System.IO.StreamReader($Device.Base32StringSeed)
$base32stringseed = $SR.ReadToEnd()
$base32stringseed   
CZWZMCQNW4DEXAMPLE3VOUGXJFZYSUW7EXAMPLECR4NJFD65GX2SLUDW2EXAMPLE
```
**Output:**  

```
-- Pause here to enter base-32 string seed code into virtual MFA program to register account. --

Enable-IAMMFADevice -SerialNumber $Device.SerialNumber -UserName Bob -AuthenticationCode1 123456 -AuthenticationCode2 789012
```
**Contoh 2: Contoh ini membuat perangkat MFA virtual baru. Baris 2 dan 3 mengekstrak `QRCodePNG` nilai dan menuliskannya ke file. Gambar ini dapat dipindai oleh program perangkat lunak MFA virtual untuk membuat akun (sebagai alternatif untuk memasukkan nilai StringSeed Base32 secara manual). Setelah Anda membuat akun di program MFA virtual Anda, dapatkan dua kode otentikasi berurutan dan masukkan dalam perintah terakhir untuk menautkan perangkat MFA virtual ke pengguna IAM dan menyinkronkan akun. `Bob`**  

```
$Device = New-IAMVirtualMFADevice -VirtualMFADeviceName BobsMFADevice
$BR = New-Object System.IO.BinaryReader($Device.QRCodePNG)
$BR.ReadBytes($BR.BaseStream.Length) | Set-Content -Encoding Byte -Path QRCode.png
```
**Output:**  

```
 -- Pause here to scan PNG with virtual MFA program to register account. -- 

Enable-IAMMFADevice -SerialNumber $Device.SerialNumber -UserName Bob -AuthenticationCode1 123456 -AuthenticationCode2 789012
```
+  Untuk detail API, lihat [CreateVirtualMfaDevice](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Publish-IAMServerCertificate`
<a name="iam_UploadServerCertificate_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Publish-IAMServerCertificate`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengunggah sertifikat server baru ke akun IAM. File yang berisi badan sertifikat, kunci pribadi, dan (opsional) rantai sertifikat semuanya harus dikodekan PEM. Perhatikan bahwa parameter memerlukan konten sebenarnya dari file daripada nama file. Anda harus menggunakan parameter `-Raw` sakelar untuk berhasil memproses konten file.**  

```
Publish-IAMServerCertificate -ServerCertificateName MyTestCert -CertificateBody (Get-Content -Raw server.crt) -PrivateKey (Get-Content -Raw server.key)
```
**Output:**  

```
Arn                   : arn:aws:iam::123456789012:server-certificate/MyTestCert
Expiration            : 1/14/2018 9:52:36 AM
Path                  : /
ServerCertificateId   : ASCAJIEXAMPLE7J7HQZYW
ServerCertificateName : MyTestCert
UploadDate            : 4/21/2015 11:14:16 AM
```
+  Untuk detail API, lihat [UploadServerCertificate](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Publish-IAMSigningCertificate`
<a name="iam_UploadSigningCertificate_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Publish-IAMSigningCertificate`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengunggah sertifikat penandatanganan X.509 baru dan mengaitkannya dengan nama pengguna IAM. `Bob` File yang berisi badan sertifikat dikodekan PEM. `CertificateBody`Parameter memerlukan konten sebenarnya dari file sertifikat daripada nama file. Anda harus menggunakan parameter `-Raw` sakelar untuk berhasil memproses file.**  

```
Publish-IAMSigningCertificate -UserName Bob -CertificateBody (Get-Content -Raw SampleSigningCert.pem)
```
**Output:**  

```
CertificateBody : -----BEGIN CERTIFICATE-----
                  MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC
                  VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6
                  b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd
                  BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN
                  MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD
                  VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z
                  b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt
                  YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ
                  21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T
                  rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE
                  Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4
                  nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb
                  FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb
                  NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE=
                  -----END CERTIFICATE-----
CertificateId   : Y3EK7RMEXAMPLESV33FCEXAMPLEHMJLU
Status          : Active
UploadDate      : 4/20/2015 1:26:01 PM
UserName        : Bob
```
+  Untuk detail API, lihat [UploadSigningCertificate](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Register-IAMGroupPolicy`
<a name="iam_AttachGroupPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Register-IAMGroupPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini melampirkan kebijakan terkelola pelanggan yang diberi nama `TesterPolicy` ke grup IAM. `Testers` Pengguna dalam grup tersebut langsung terpengaruh oleh izin yang ditentukan dalam versi default kebijakan tersebut.**  

```
Register-IAMGroupPolicy -GroupName Testers -PolicyArn arn:aws:iam::123456789012:policy/TesterPolicy
```
**Contoh 2: Contoh ini melampirkan kebijakan AWS terkelola bernama `AdministratorAccess` ke grup IAM. `Admins` Pengguna dalam grup tersebut langsung terpengaruh oleh izin yang ditentukan dalam versi terbaru kebijakan tersebut.**  

```
Register-IAMGroupPolicy -GroupName Admins -PolicyArn arn:aws:iam::aws:policy/AdministratorAccess
```
+  Untuk detail API, lihat [AttachGroupPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Register-IAMRolePolicy`
<a name="iam_AttachRolePolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Register-IAMRolePolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini melampirkan kebijakan AWS terkelola yang diberi nama `SecurityAudit` ke peran IAM. `CoSecurityAuditors` Pengguna yang menganggap peran tersebut langsung terpengaruh oleh izin yang ditentukan dalam versi terbaru kebijakan tersebut.**  

```
Register-IAMRolePolicy -RoleName CoSecurityAuditors -PolicyArn arn:aws:iam::aws:policy/SecurityAudit
```
+  Untuk detail API, lihat [AttachRolePolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Register-IAMUserPolicy`
<a name="iam_AttachUserPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Register-IAMUserPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini melampirkan kebijakan AWS terkelola bernama `AmazonCognitoPowerUser` ke pengguna IAM. `Bob` Pengguna langsung terpengaruh oleh izin yang ditentukan dalam versi terbaru kebijakan tersebut.**  

```
Register-IAMUserPolicy -UserName Bob -PolicyArn arn:aws:iam::aws:policy/AmazonCognitoPowerUser
```
+  Untuk detail API, lihat [AttachUserPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMAccessKey`
<a name="iam_DeleteAccessKey_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMAccessKey`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus AWS access key pair dengan ID kunci `AKIAIOSFODNN7EXAMPLE` dari nama `Bob` pengguna.**  

```
Remove-IAMAccessKey -AccessKeyId AKIAIOSFODNN7EXAMPLE -UserName Bob -Force
```
+  Untuk detail API, lihat [DeleteAccessKey](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMAccountAlias`
<a name="iam_DeleteAccountAlias_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMAccountAlias`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus alias akun dari akun Anda Akun AWS. Halaman login pengguna dengan alias di https://mycom panyaws.signin.aws.amazon.com/console tidak lagi berfungsi. Sebagai gantinya, Anda harus menggunakan URL asli dengan nomor Akun AWS ID Anda di https://.signin.aws.amazon.com/console.** <accountidnumber>  

```
Remove-IAMAccountAlias -AccountAlias mycompanyaws
```
+  Untuk detail API, lihat [DeleteAccountAlias](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMAccountPasswordPolicy`
<a name="iam_DeleteAccountPasswordPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMAccountPasswordPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus kebijakan kata sandi untuk Akun AWS dan mengatur ulang semua nilai ke default aslinya. Jika kebijakan kata sandi saat ini tidak ada, pesan galat berikut akan muncul: Kebijakan akun dengan nama PasswordPolicy tidak dapat ditemukan.**  

```
Remove-IAMAccountPasswordPolicy
```
+  Untuk detail API, lihat [DeleteAccountPasswordPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMClientIDFromOpenIDConnectProvider`
<a name="iam_RemoveClientIdFromOpenIdConnectProvider_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMClientIDFromOpenIDConnectProvider`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus ID klien `My-TestApp-3` dari daftar klien yang IDs terkait dengan penyedia IAM OIDC yang ARN-nya. `arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com`**  

```
Remove-IAMClientIDFromOpenIDConnectProvider -ClientID My-TestApp-3 -OpenIDConnectProviderArn arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com
```
+  Untuk detail API, lihat [RemoveClientIdFromOpenIdConnectProvider](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMGroup`
<a name="iam_DeleteGroup_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMGroup`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus grup IAM bernama. `MyTestGroup` Perintah pertama menghapus setiap pengguna IAM yang merupakan anggota grup, dan perintah kedua menghapus grup IAM. Kedua perintah bekerja tanpa ada petunjuk untuk konfirmasi.**  

```
(Get-IAMGroup -GroupName MyTestGroup).Users | Remove-IAMUserFromGroup -GroupName MyTestGroup -Force
Remove-IAMGroup -GroupName MyTestGroup -Force
```
+  Untuk detail API, lihat [DeleteGroup](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMGroupPolicy`
<a name="iam_DeleteGroupPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMGroupPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus kebijakan inline bernama `TesterPolicy` dari grup IAM. `Testers` Pengguna dalam grup tersebut segera kehilangan izin yang ditentukan dalam kebijakan tersebut.**  

```
Remove-IAMGroupPolicy -GroupName Testers -PolicyName TestPolicy
```
+  Untuk detail API, lihat [DeleteGroupPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMInstanceProfile`
<a name="iam_DeleteInstanceProfile_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMInstanceProfile`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus profil EC2 instance bernama`MyAppInstanceProfile`. Perintah pertama melepaskan peran apa pun dari profil instance, dan kemudian perintah kedua menghapus profil instance.**  

```
(Get-IAMInstanceProfile -InstanceProfileName MyAppInstanceProfile).Roles | Remove-IAMRoleFromInstanceProfile -InstanceProfileName MyAppInstanceProfile
Remove-IAMInstanceProfile -InstanceProfileName MyAppInstanceProfile
```
+  Untuk detail API, lihat [DeleteInstanceProfile](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMLoginProfile`
<a name="iam_DeleteLoginProfile_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMLoginProfile`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus profil login dari pengguna IAM bernama. `Bob` Ini mencegah pengguna masuk ke konsol. AWS Itu tidak mencegah pengguna menjalankan AWS CLI, PowerShell, atau panggilan API apa pun menggunakan kunci AWS akses yang mungkin masih dilampirkan ke akun pengguna.**  

```
Remove-IAMLoginProfile -UserName Bob
```
+  Untuk detail API, lihat [DeleteLoginProfile](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMOpenIDConnectProvider`
<a name="iam_DeleteOpenIdConnectProvider_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMOpenIDConnectProvider`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus penyedia IAM OIDC yang terhubung ke penyedia. `example.oidcprovider.com` Pastikan Anda memperbarui atau menghapus peran apa pun yang mereferensikan penyedia ini dalam `Principal` elemen kebijakan kepercayaan peran.**  

```
Remove-IAMOpenIDConnectProvider -OpenIDConnectProviderArn arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com
```
+  Untuk detail API, lihat [DeleteOpenIdConnectProvider](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMPolicy`
<a name="iam_DeletePolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus kebijakan `arn:aws:iam::123456789012:policy/MySamplePolicy` ARN-nya. Sebelum Anda dapat menghapus kebijakan, Anda harus terlebih dahulu menghapus semua versi kecuali default dengan menjalankan`Remove-IAMPolicyVersion`. Anda juga harus melepaskan kebijakan dari setiap pengguna, grup, atau peran IAM.**  

```
Remove-IAMPolicy -PolicyArn arn:aws:iam::123456789012:policy/MySamplePolicy
```
**Contoh 2: Contoh ini menghapus kebijakan dengan terlebih dahulu menghapus semua versi kebijakan non-default, melepaskannya dari semua entitas IAM terlampir, dan akhirnya menghapus kebijakan itu sendiri. Baris pertama mengambil objek kebijakan. Baris kedua mengambil semua versi kebijakan yang tidak ditandai sebagai versi default ke dalam koleksi dan kemudian menghapus setiap kebijakan dalam koleksi. Baris ketiga mengambil semua pengguna, grup, dan peran IAM yang dilampirkan kebijakan tersebut. Baris empat hingga enam melepaskan kebijakan dari setiap entitas terlampir. Baris terakhir menggunakan perintah ini untuk menghapus kebijakan terkelola serta versi default yang tersisa. Contohnya termasuk parameter `-Force` sakelar pada baris apa pun yang membutuhkannya untuk menekan permintaan konfirmasi.**  

```
$pol = Get-IAMPolicy -PolicyArn arn:aws:iam::123456789012:policy/MySamplePolicy
Get-IAMPolicyVersions -PolicyArn $pol.Arn | where {-not $_.IsDefaultVersion} | Remove-IAMPolicyVersion -PolicyArn $pol.Arn -force
$attached = Get-IAMEntitiesForPolicy -PolicyArn $pol.Arn
$attached.PolicyGroups | Unregister-IAMGroupPolicy -PolicyArn $pol.arn
$attached.PolicyRoles | Unregister-IAMRolePolicy -PolicyArn $pol.arn
$attached.PolicyUsers | Unregister-IAMUserPolicy -PolicyArn $pol.arn
Remove-IAMPolicy $pol.Arn -Force
```
+  Untuk detail API, lihat [DeletePolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMPolicyVersion`
<a name="iam_DeletePolicyVersion_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMPolicyVersion`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus versi yang diidentifikasi sebagai `v2` dari kebijakan yang `arn:aws:iam::123456789012:policy/MySamplePolicy` ARN-nya.**  

```
Remove-IAMPolicyVersion -PolicyArn arn:aws:iam::123456789012:policy/MySamplePolicy -VersionID v2
```
**Contoh 2: Contoh ini menghapus kebijakan dengan terlebih dahulu menghapus semua versi kebijakan non-default dan kemudian menghapus kebijakan itu sendiri. Baris pertama mengambil objek kebijakan. Baris kedua mengambil semua versi kebijakan yang tidak ditandai sebagai default ke dalam koleksi dan kemudian menggunakan perintah ini untuk menghapus setiap kebijakan dalam koleksi. Baris terakhir menghapus kebijakan itu sendiri serta versi default yang tersisa. Perhatikan bahwa agar berhasil menghapus kebijakan terkelola, Anda juga harus melepaskan kebijakan dari pengguna, grup, atau peran apa pun dengan menggunakan perintah`Unregister-IAMUserPolicy`,`Unregister-IAMGroupPolicy`, dan `Unregister-IAMRolePolicy` perintah. Lihat contoh untuk `Remove-IAMPolicy` cmdlet.**  

```
$pol = Get-IAMPolicy -PolicyArn arn:aws:iam::123456789012:policy/MySamplePolicy
Get-IAMPolicyVersions -PolicyArn $pol.Arn | where {-not $_.IsDefaultVersion} | Remove-IAMPolicyVersion -PolicyArn $pol.Arn -force
Remove-IAMPolicy -PolicyArn $pol.Arn -force
```
+  Untuk detail API, lihat [DeletePolicyVersion](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMRole`
<a name="iam_DeleteRole_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMRole`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus peran yang dinamai `MyNewRole` dari akun IAM saat ini. Sebelum Anda dapat menghapus peran, Anda harus terlebih dahulu menggunakan `Unregister-IAMRolePolicy` perintah untuk melepaskan kebijakan terkelola apa pun. Kebijakan sebaris dihapus dengan peran tersebut.**  

```
Remove-IAMRole -RoleName MyNewRole
```
**Contoh 2: Contoh ini melepaskan kebijakan terkelola dari peran bernama `MyNewRole` dan kemudian menghapus peran tersebut. Baris pertama mengambil kebijakan terkelola yang melekat pada peran sebagai koleksi dan kemudian melepaskan setiap kebijakan dalam koleksi dari peran tersebut. Baris kedua menghapus peran itu sendiri. Kebijakan inline dihapus bersama dengan peran.**  

```
Get-IAMAttachedRolePolicyList -RoleName MyNewRole | Unregister-IAMRolePolicy -RoleName MyNewRole
Remove-IAMRole -RoleName MyNewRole
```
+  Untuk detail API, lihat [DeleteRole](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMRoleFromInstanceProfile`
<a name="iam_RemoveRoleFromInstanceProfile_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMRoleFromInstanceProfile`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus peran bernama `MyNewRole` dari profil EC2 instance bernama`MyNewRole`. Profil instance yang dibuat di konsol IAM selalu memiliki nama yang sama dengan peran, seperti dalam contoh ini. Jika Anda membuatnya di API atau CLI, maka mereka dapat memiliki nama yang berbeda.**  

```
Remove-IAMRoleFromInstanceProfile -InstanceProfileName MyNewRole -RoleName MyNewRole -Force
```
+  Untuk detail API, lihat [RemoveRoleFromInstanceProfile](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMRolePermissionsBoundary`
<a name="iam_DeleteRolePermissionsBoundary_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMRolePermissionsBoundary`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menunjukkan cara menghapus batas izin yang dilampirkan ke peran IAM.**  

```
Remove-IAMRolePermissionsBoundary -RoleName MyRoleName
```
+  Untuk detail API, lihat [DeleteRolePermissionsBoundary](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMRolePolicy`
<a name="iam_DeleteRolePolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMRolePolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus kebijakan inline `S3AccessPolicy` yang disematkan dalam peran IAM. `S3BackupRole`**  

```
Remove-IAMRolePolicy -PolicyName S3AccessPolicy -RoleName S3BackupRole
```
+  Untuk detail API, lihat [DeleteRolePolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMRoleTag`
<a name="iam_UntagRole_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMRoleTag`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus tag dari peran bernama "MyRoleName" dengan kunci tag sebagai “abac”. Untuk menghapus beberapa tag, berikan daftar kunci tag yang dipisahkan koma.**  

```
Remove-IAMRoleTag -RoleName MyRoleName -TagKey "abac","xyzw"
```
+  Untuk detail API, lihat [UntagRole](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMSAMLProvider`
<a name="iam_DeleteSAMLProvider_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMSAMLProvider`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus penyedia IAM SALL 2.0 yang ARN-nya. `arn:aws:iam::123456789012:saml-provider/SAMLADFSProvider`**  

```
Remove-IAMSAMLProvider -SAMLProviderArn arn:aws:iam::123456789012:saml-provider/SAMLADFSProvider
```
+  Untuk detail API, lihat [Menghapus SAMLProvider](https://docs.aws.amazon.com/powershell/v5/reference) di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMServerCertificate`
<a name="iam_DeleteServerCertificate_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMServerCertificate`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus sertifikat server bernama`MyServerCert`.**  

```
Remove-IAMServerCertificate -ServerCertificateName MyServerCert
```
+  Untuk detail API, lihat [DeleteServerCertificate](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMServiceLinkedRole`
<a name="iam_DeleteServiceLinkedRole_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMServiceLinkedRole`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus peran terkait layanan. Harap dicatat bahwa jika layanan masih menggunakan peran ini, maka perintah ini mengakibatkan kegagalan.**  

```
Remove-IAMServiceLinkedRole -RoleName AWSServiceRoleForAutoScaling_RoleNameEndsWithThis
```
+  Untuk detail API, lihat [DeleteServiceLinkedRole](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMSigningCertificate`
<a name="iam_DeleteSigningCertificate_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMSigningCertificate`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus sertifikat penandatanganan dengan ID `Y3EK7RMEXAMPLESV33FCREXAMPLEMJLU` dari pengguna IAM bernama. `Bob`**  

```
Remove-IAMSigningCertificate -UserName Bob -CertificateId Y3EK7RMEXAMPLESV33FCREXAMPLEMJLU
```
+  Untuk detail API, lihat [DeleteSigningCertificate](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMUser`
<a name="iam_DeleteUser_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMUser`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus nama pengguna IAM. `Bob`**  

```
Remove-IAMUser -UserName Bob
```
**Contoh 2: Contoh ini menghapus nama pengguna IAM `Theresa` bersama dengan elemen apa pun yang harus dihapus terlebih dahulu.**  

```
$name = "Theresa"

# find any groups and remove user from them
$groups = Get-IAMGroupForUser -UserName $name
foreach ($group in $groups) { Remove-IAMUserFromGroup -GroupName $group.GroupName -UserName $name -Force }

# find any inline policies and delete them
$inlinepols = Get-IAMUserPolicies -UserName $name
foreach ($pol in $inlinepols) { Remove-IAMUserPolicy -PolicyName $pol -UserName $name -Force}

# find any managed polices and detach them
$managedpols = Get-IAMAttachedUserPolicies -UserName $name
foreach ($pol in $managedpols) { Unregister-IAMUserPolicy -PolicyArn $pol.PolicyArn -UserName $name }

# find any signing certificates and delete them
$certs = Get-IAMSigningCertificate -UserName $name
foreach ($cert in $certs) { Remove-IAMSigningCertificate -CertificateId $cert.CertificateId -UserName $name -Force }

# find any access keys and delete them
$keys = Get-IAMAccessKey -UserName $name
foreach ($key in $keys) { Remove-IAMAccessKey -AccessKeyId $key.AccessKeyId -UserName $name -Force }

# delete the user's login profile, if one exists - note: need to use try/catch to suppress not found error
try { $prof = Get-IAMLoginProfile -UserName $name -ea 0 } catch { out-null }
if ($prof) { Remove-IAMLoginProfile -UserName $name -Force }

# find any MFA device, detach it, and if virtual, delete it.
$mfa = Get-IAMMFADevice -UserName $name
if ($mfa) { 
    Disable-IAMMFADevice -SerialNumber $mfa.SerialNumber -UserName $name 
    if ($mfa.SerialNumber -like "arn:*") { Remove-IAMVirtualMFADevice -SerialNumber $mfa.SerialNumber }
}

# finally, remove the user
Remove-IAMUser -UserName $name -Force
```
+  Untuk detail API, lihat [DeleteUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMUserFromGroup`
<a name="iam_RemoveUserFromGroup_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMUserFromGroup`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus pengguna IAM `Bob` dari grup`Testers`.**  

```
Remove-IAMUserFromGroup -GroupName Testers -UserName Bob
```
**Contoh 2: Contoh ini menemukan grup yang pengguna IAM `Theresa` adalah anggota, dan kemudian dihapus `Theresa` dari grup tersebut.**  

```
$groups = Get-IAMGroupForUser -UserName Theresa 
foreach ($group in $groups) { Remove-IAMUserFromGroup -GroupName $group.GroupName -UserName Theresa -Force }
```
**Contoh 3: Contoh ini menunjukkan cara alternatif untuk menghapus pengguna IAM `Bob` dari `Testers` grup.**  

```
Get-IAMGroupForUser -UserName Bob | Remove-IAMUserFromGroup -UserName Bob -GroupName Testers -Force
```
+  Untuk detail API, lihat [RemoveUserFromGroup](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMUserPermissionsBoundary`
<a name="iam_DeleteUserPermissionsBoundary_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMUserPermissionsBoundary`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menunjukkan cara menghapus batas izin yang dilampirkan ke pengguna IAM.**  

```
Remove-IAMUserPermissionsBoundary -UserName joe
```
+  Untuk detail API, lihat [DeleteUserPermissionsBoundary](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMUserPolicy`
<a name="iam_DeleteUserPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMUserPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus kebijakan inline bernama `AccessToEC2Policy` yang disematkan dalam nama pengguna IAM. `Bob`**  

```
Remove-IAMUserPolicy -PolicyName AccessToEC2Policy -UserName Bob
```
**Contoh 2: Contoh ini menemukan semua kebijakan inline yang disematkan dalam nama pengguna IAM `Theresa` dan kemudian menghapusnya.**  

```
$inlinepols = Get-IAMUserPolicies -UserName Theresa
foreach ($pol in $inlinepols) { Remove-IAMUserPolicy -PolicyName $pol -UserName Theresa -Force}
```
+  Untuk detail API, lihat [DeleteUserPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMUserTag`
<a name="iam_UntagUser_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMUserTag`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus tag dari pengguna bernama “joe” dengan kunci tag sebagai “abac” dan “xyzw”. Untuk menghapus beberapa tag, berikan daftar kunci tag yang dipisahkan koma.**  

```
Remove-IAMUserTag -UserName joe -TagKey "abac","xyzw"
```
+  Untuk detail API, lihat [UntagUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-IAMVirtualMFADevice`
<a name="iam_DeleteVirtualMfaDevice_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Remove-IAMVirtualMFADevice`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus perangkat MFA virtual IAM yang ARN-nya. `arn:aws:iam::123456789012:mfa/bob`**  

```
Remove-IAMVirtualMFADevice -SerialNumber arn:aws:iam::123456789012:mfa/bob
```
**Contoh 2: Contoh ini memeriksa untuk melihat apakah pengguna IAM Theresa memiliki perangkat MFA yang ditetapkan. Jika ditemukan, perangkat dinonaktifkan untuk pengguna IAM. Jika perangkat virtual, maka itu juga dihapus.**  

```
$mfa = Get-IAMMFADevice -UserName Theresa
if ($mfa) { 
    Disable-IAMMFADevice -SerialNumber $mfa.SerialNumber -UserName $name 
    if ($mfa.SerialNumber -like "arn:*") { Remove-IAMVirtualMFADevice -SerialNumber $mfa.SerialNumber }
}
```
+  Untuk detail API, lihat [DeleteVirtualMfaDevice](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Request-IAMCredentialReport`
<a name="iam_GenerateCredentialReport_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Request-IAMCredentialReport`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini meminta pembuatan laporan baru, yang dapat dilakukan setiap empat jam. Jika laporan terakhir masih terbaru, bidang Negara berbunyi`COMPLETE`. Gunakan `Get-IAMCredentialReport` untuk melihat laporan yang sudah selesai.**  

```
Request-IAMCredentialReport
```
**Output:**  

```
Description                                                    State
-----------                                                    -----
No report exists. Starting a new report generation task        STARTED
```
+  Untuk detail API, lihat [GenerateCredentialReport](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Request-IAMServiceLastAccessedDetail`
<a name="iam_GenerateServiceLastAccessedDetails_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Request-IAMServiceLastAccessedDetail`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini setara dengan cmdlet API. GenerateServiceLastAccessedDetails Ini menyediakan dengan id pekerjaan yang dapat digunakan di Get-IAMServiceLastAccessedDetail dan Dapatkan- IAMService LastAccessedDetailWithEntity**  

```
Request-IAMServiceLastAccessedDetail -Arn arn:aws:iam::123456789012:user/TestUser
```
+  Untuk detail API, lihat [GenerateServiceLastAccessedDetails](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Set-IAMDefaultPolicyVersion`
<a name="iam_SetDefaultPolicyVersion_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Set-IAMDefaultPolicyVersion`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menetapkan `v2` versi kebijakan yang ARN-nya `arn:aws:iam::123456789012:policy/MyPolicy` sebagai versi aktif default.**  

```
Set-IAMDefaultPolicyVersion -PolicyArn arn:aws:iam::123456789012:policy/MyPolicy -VersionId v2
```
+  Untuk detail API, lihat [SetDefaultPolicyVersion](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Set-IAMRolePermissionsBoundary`
<a name="iam_PutRolePermissionsBoundary_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Set-IAMRolePermissionsBoundary`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menunjukkan cara mengatur batas Izin untuk Peran IAM. Anda dapat menetapkan Kebijakan AWS terkelola atau Kebijakan khusus sebagai batas izin.**  

```
Set-IAMRolePermissionsBoundary -RoleName MyRoleName -PermissionsBoundary arn:aws:iam::123456789012:policy/intern-boundary
```
+  Untuk detail API, lihat [PutRolePermissionsBoundary](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Set-IAMUserPermissionsBoundary`
<a name="iam_PutUserPermissionsBoundary_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Set-IAMUserPermissionsBoundary`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menunjukkan cara mengatur batas Izin untuk pengguna. Anda dapat menetapkan Kebijakan AWS terkelola atau Kebijakan khusus sebagai batas izin.**  

```
Set-IAMUserPermissionsBoundary -UserName joe -PermissionsBoundary arn:aws:iam::123456789012:policy/intern-boundary
```
+  Untuk detail API, lihat [PutUserPermissionsBoundary](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Sync-IAMMFADevice`
<a name="iam_ResyncMfaDevice_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Sync-IAMMFADevice`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menyinkronkan perangkat MFA yang terkait dengan pengguna IAM `Bob` dan ARN-nya dengan program autentikator yang `arn:aws:iam::123456789012:mfa/bob` menyediakan dua kode otentikasi.**  

```
Sync-IAMMFADevice -SerialNumber arn:aws:iam::123456789012:mfa/theresa -AuthenticationCode1 123456 -AuthenticationCode2 987654 -UserName Bob
```
**Contoh 2: Contoh ini menyinkronkan perangkat IAM MFA yang dikaitkan dengan pengguna `Theresa` IAM dengan perangkat fisik yang memiliki nomor seri `ABCD12345678` dan yang menyediakan dua kode otentikasi.**  

```
Sync-IAMMFADevice -SerialNumber ABCD12345678 -AuthenticationCode1 123456 -AuthenticationCode2 987654 -UserName Theresa
```
+  Untuk detail API, lihat [ResyncMfaDevice](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Unregister-IAMGroupPolicy`
<a name="iam_DetachGroupPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Unregister-IAMGroupPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini melepaskan kebijakan grup terkelola yang `arn:aws:iam::123456789012:policy/TesterAccessPolicy` ARNnya berasal dari grup bernama. `Testers`**  

```
Unregister-IAMGroupPolicy -GroupName Testers -PolicyArn arn:aws:iam::123456789012:policy/TesterAccessPolicy
```
**Contoh 2: Contoh ini menemukan semua kebijakan terkelola yang dilampirkan pada grup bernama `Testers` dan memisahkannya dari grup.**  

```
Get-IAMAttachedGroupPolicies -GroupName Testers | Unregister-IAMGroupPolicy -Groupname Testers
```
+  Untuk detail API, lihat [DetachGroupPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Unregister-IAMRolePolicy`
<a name="iam_DetachRolePolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Unregister-IAMRolePolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini melepaskan kebijakan grup terkelola yang `arn:aws:iam::123456789012:policy/FederatedTesterAccessPolicy` ARNnya berasal dari peran bernama. `FedTesterRole`**  

```
Unregister-IAMRolePolicy -RoleName FedTesterRole -PolicyArn arn:aws:iam::123456789012:policy/FederatedTesterAccessPolicy
```
**Contoh 2: Contoh ini menemukan semua kebijakan terkelola yang dilampirkan pada peran yang diberi nama `FedTesterRole` dan memisahkannya dari peran.**  

```
Get-IAMAttachedRolePolicyList -RoleName FedTesterRole | Unregister-IAMRolePolicy -Rolename FedTesterRole
```
+  Untuk detail API, lihat [DetachRolePolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Unregister-IAMUserPolicy`
<a name="iam_DetachUserPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Unregister-IAMUserPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini melepaskan kebijakan terkelola yang ARNnya berasal dari `arn:aws:iam::123456789012:policy/TesterPolicy` nama pengguna IAM. `Bob`**  

```
Unregister-IAMUserPolicy -UserName Bob -PolicyArn arn:aws:iam::123456789012:policy/TesterPolicy
```
**Contoh 2: Contoh ini menemukan semua kebijakan terkelola yang dilampirkan ke pengguna IAM bernama `Theresa` dan melepaskan kebijakan tersebut dari pengguna.**  

```
Get-IAMAttachedUserPolicyList -UserName Theresa | Unregister-IAMUserPolicy -Username Theresa
```
+  Untuk detail API, lihat [DetachUserPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMAccessKey`
<a name="iam_UpdateAccessKey_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMAccessKey`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengubah status kunci akses `AKIAIOSFODNN7EXAMPLE` untuk pengguna IAM bernama`Bob`. `Inactive`**  

```
Update-IAMAccessKey -UserName Bob -AccessKeyId AKIAIOSFODNN7EXAMPLE -Status Inactive
```
+  Untuk detail API, lihat [UpdateAccessKey](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMAccountPasswordPolicy`
<a name="iam_UpdateAccountPasswordPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMAccountPasswordPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui kebijakan kata sandi untuk akun dengan pengaturan yang ditentukan. Perhatikan bahwa parameter apa pun yang tidak termasuk dalam perintah tidak dibiarkan tidak dimodifikasi. Sebaliknya, mereka diatur ulang ke nilai default.**  

```
Update-IAMAccountPasswordPolicy -AllowUsersToChangePasswords $true -HardExpiry $false -MaxPasswordAge 90 -MinimumPasswordLength 8 -PasswordReusePrevention 20 -RequireLowercaseCharacters $true -RequireNumbers $true -RequireSymbols $true -RequireUppercaseCharacters $true
```
+  Untuk detail API, lihat [UpdateAccountPasswordPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMAssumeRolePolicy`
<a name="iam_UpdateAssumeRolePolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMAssumeRolePolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui peran IAM yang diberi nama `ClientRole` dengan kebijakan kepercayaan baru, yang isinya berasal dari file`ClientRolePolicy.json`. Perhatikan bahwa Anda harus menggunakan parameter `-Raw` switch untuk berhasil memproses isi file JSON.**  

```
Update-IAMAssumeRolePolicy -RoleName ClientRole -PolicyDocument (Get-Content -raw ClientRolePolicy.json)
```
+  Untuk detail API, lihat [UpdateAssumeRolePolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMGroup`
<a name="iam_UpdateGroup_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMGroup`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengganti nama grup IAM menjadi. `Testers` `AppTesters`**  

```
Update-IAMGroup -GroupName Testers -NewGroupName AppTesters
```
**Contoh 2: Contoh ini mengubah jalur grup IAM `AppTesters` menjadi`/Org1/Org2/`. Ini mengubah ARN untuk grup menjadi. `arn:aws:iam::123456789012:group/Org1/Org2/AppTesters`**  

```
Update-IAMGroup -GroupName AppTesters -NewPath /Org1/Org2/
```
+  Untuk detail API, lihat [UpdateGroup](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMLoginProfile`
<a name="iam_UpdateLoginProfile_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMLoginProfile`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menetapkan kata sandi sementara baru untuk pengguna IAM`Bob`, dan mengharuskan pengguna untuk mengubah kata sandi saat pengguna masuk berikutnya.**  

```
Update-IAMLoginProfile -UserName Bob -Password "P@ssw0rd1234" -PasswordResetRequired $true
```
+  Untuk detail API, lihat [UpdateLoginProfile](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMOpenIDConnectProviderThumbprint`
<a name="iam_UpdateOpenIdConnectProviderThumbprint_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMOpenIDConnectProviderThumbprint`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui daftar cap jempol sertifikat untuk penyedia OIDC yang ARN-nya menggunakan sidik jari baru. `arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com` Penyedia OIDC membagikan nilai baru ketika sertifikat yang terkait dengan penyedia berubah.**  

```
Update-IAMOpenIDConnectProviderThumbprint -OpenIDConnectProviderArn arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com -ThumbprintList 7359755EXAMPLEabc3060bce3EXAMPLEec4542a3
```
+  Untuk detail API, lihat [UpdateOpenIdConnectProviderThumbprint](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMRole`
<a name="iam_UpdateRole_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMRole`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui deskripsi peran dan nilai durasi sesi maksimum (dalam detik) yang sesi peran dapat diminta.**  

```
Update-IAMRole -RoleName MyRoleName -Description "My testing role" -MaxSessionDuration 43200
```
+  Untuk detail API, lihat [UpdateRole](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMRoleDescription`
<a name="iam_UpdateRoleDescription_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMRoleDescription`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui deskripsi peran IAM di akun Anda.**  

```
Update-IAMRoleDescription -RoleName MyRoleName -Description "My testing role"
```
+  Untuk detail API, lihat [UpdateRoleDescription](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMSAMLProvider`
<a name="iam_UpdateSamlProvider_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMSAMLProvider`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui penyedia SAMP di IAM yang ARN-nya `arn:aws:iam::123456789012:saml-provider/SAMLADFS` dengan dokumen metadata SAMP baru dari file. `SAMLMetaData.xml` Perhatikan bahwa Anda harus menggunakan parameter `-Raw` switch untuk berhasil memproses isi file JSON.**  

```
Update-IAMSAMLProvider -SAMLProviderArn arn:aws:iam::123456789012:saml-provider/SAMLADFS -SAMLMetadataDocument (Get-Content -Raw SAMLMetaData.xml)
```
+  Untuk detail API, lihat [UpdateSamlProvider](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMServerCertificate`
<a name="iam_UpdateServerCertificate_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMServerCertificate`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengganti nama sertifikat yang dinamai`MyServerCertificate`. `MyRenamedServerCertificate`**  

```
Update-IAMServerCertificate -ServerCertificateName MyServerCertificate -NewServerCertificateName MyRenamedServerCertificate
```
**Contoh 2: Contoh ini memindahkan sertifikat bernama `MyServerCertificate` ke path /Org1/Org2/. Ini mengubah ARN untuk sumber daya menjadi. `arn:aws:iam::123456789012:server-certificate/Org1/Org2/MyServerCertificate`**  

```
Update-IAMServerCertificate -ServerCertificateName MyServerCertificate -NewPath /Org1/Org2/
```
+  Untuk detail API, lihat [UpdateServerCertificate](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMSigningCertificate`
<a name="iam_UpdateSigningCertificate_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMSigningCertificate`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui sertifikat yang terkait dengan nama pengguna IAM `Bob` dan yang ID sertifikatnya `Y3EK7RMEXAMPLESV33FCREXAMPLEMJLU` untuk menandainya sebagai tidak aktif.**  

```
Update-IAMSigningCertificate -CertificateId Y3EK7RMEXAMPLESV33FCREXAMPLEMJLU -UserName Bob -Status Inactive
```
+  Untuk detail API, lihat [UpdateSigningCertificate](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-IAMUser`
<a name="iam_UpdateUser_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Update-IAMUser`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengganti nama pengguna IAM menjadi. `Bob` `Robert`**  

```
Update-IAMUser -UserName Bob -NewUserName Robert
```
**Contoh 2: Contoh ini mengubah jalur Pengguna IAM `Bob` ke`/Org1/Org2/`, yang secara efektif mengubah ARN untuk pengguna. `arn:aws:iam::123456789012:user/Org1/Org2/bob`**  

```
Update-IAMUser -UserName Bob -NewPath /Org1/Org2/
```
+  Untuk detail API, lihat [UpdateUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Write-IAMGroupPolicy`
<a name="iam_PutGroupPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Write-IAMGroupPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat kebijakan inline bernama `AppTesterPolicy` dan menyematkannya dalam grup IAM. `AppTesters` Jika kebijakan inline dengan nama yang sama sudah ada, maka itu akan ditimpa. Konten kebijakan JSON datang file`apptesterpolicy.json`. Perhatikan bahwa Anda harus menggunakan `-Raw` parameter untuk berhasil memproses konten file JSON.**  

```
Write-IAMGroupPolicy -GroupName AppTesters -PolicyName AppTesterPolicy -PolicyDocument (Get-Content -Raw apptesterpolicy.json)
```
+  Untuk detail API, lihat [PutGroupPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Write-IAMRolePolicy`
<a name="iam_PutRolePolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Write-IAMRolePolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat kebijakan inline bernama `FedTesterRolePolicy` dan menyematkannya dalam peran IAM. `FedTesterRole` Jika kebijakan inline dengan nama yang sama sudah ada, maka itu akan ditimpa. Konten kebijakan JSON berasal dari file`FedTesterPolicy.json`. Perhatikan bahwa Anda harus menggunakan `-Raw` parameter untuk berhasil memproses konten file JSON.**  

```
Write-IAMRolePolicy -RoleName FedTesterRole -PolicyName FedTesterRolePolicy -PolicyDocument (Get-Content -Raw FedTesterPolicy.json)
```
+  Untuk detail API, lihat [PutRolePolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Write-IAMUserPolicy`
<a name="iam_PutUserPolicy_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Write-IAMUserPolicy`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat kebijakan inline bernama `EC2AccessPolicy` dan menyematkannya di pengguna IAM. `Bob` Jika kebijakan inline dengan nama yang sama sudah ada, maka itu akan ditimpa. Konten kebijakan JSON berasal dari file`EC2AccessPolicy.json`. Perhatikan bahwa Anda harus menggunakan `-Raw` parameter untuk berhasil memproses konten file JSON.**  

```
Write-IAMUserPolicy -UserName Bob -PolicyName EC2AccessPolicy -PolicyDocument (Get-Content -Raw EC2AccessPolicy.json)
```
+  Untuk detail API, lihat [PutUserPolicy](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 