

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.

# Directory Service contoh menggunakan Alat untuk PowerShell V5
<a name="powershell_directory-service_code_examples"></a>

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

*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-DSIpRoute`
<a name="directory-service_AddIpRoutes_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini menghapus Tag Sumber Daya yang ditetapkan ke ID Direktori yang ditentukan**  

```
Add-DSIpRoute -DirectoryId d-123456ijkl -IpRoute @{CidrIp ="203.0.113.5/32"} -UpdateSecurityGroupForDirectoryController $true
```
+  Untuk detail API, lihat [AddIpRoutes](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Add-DSResourceTag`
<a name="directory-service_AddTagsToResource_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini menambahkan Tag Sumber Daya ke ID Direktori yang ditentukan**  

```
Add-DSResourceTag -ResourceId d-123456ijkl -Tag @{Key="myTag"; Value="mytgValue"}
```
+  Untuk detail API, lihat [AddTagsToResource](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Approve-DSTrust`
<a name="directory-service_VerifyTrust_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Approve-DSTrust`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memanggil operasi AWS Directory Service VerifyTrust API untuk Trustid tertentu.**  

```
Approve-DSTrust -TrustId t-9067157123
```
+  Untuk detail API, lihat [VerifyTrust](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Confirm-DSSharedDirectory`
<a name="directory-service_AcceptSharedDirectory_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Confirm-DSSharedDirectory`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menerima permintaan berbagi direktori yang dikirim dari pemilik Akun AWS direktori.**  

```
Confirm-DSSharedDirectory -SharedDirectoryId d-9067012345
```
**Output:**  

```
CreatedDateTime     : 12/30/2019 4:20:27 AM
LastUpdatedDateTime : 12/30/2019 4:21:40 AM
OwnerAccountId      : 123456781234
OwnerDirectoryId    : d-123456ijkl
SharedAccountId     : 123456784321
SharedDirectoryId   : d-9067012345
ShareMethod         :
ShareNotes          : This is test sharing
ShareStatus         : Sharing
```
+  Untuk detail API, lihat [AcceptSharedDirectory](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Connect-DSDirectory`
<a name="directory-service_ConnectDirectory_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Connect-DSDirectory`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat AD Connector untuk terhubung ke direktori lokal.**  

```
Connect-DSDirectory -Name contoso.com -ConnectSettings_CustomerUserName Administrator -Password $Password -ConnectSettings_CustomerDnsIp 172.31.36.96 -ShortName CONTOSO -Size Small -ConnectSettings_VpcId vpc-123459da -ConnectSettings_SubnetId subnet-1234ccaa, subnet-5678ffbb
```
+  Untuk detail API, lihat [ConnectDirectory](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Deny-DSSharedDirectory`
<a name="directory-service_RejectSharedDirectory_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Deny-DSSharedDirectory`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menolak permintaan berbagi direktori yang dikirim dari akun pemilik direktori.**  

```
Deny-DSSharedDirectory -SharedDirectoryId d-9067012345
```
**Output:**  

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

### `Disable-DSDirectoryShare`
<a name="directory-service_UnshareDirectory_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghentikan pembagian direktori antara pemilik direktori dan akun konsumen.**  

```
Disable-DSDirectoryShare -DirectoryId d-123456ijkl -UnshareTarget_Id 123456784321 -UnshareTarget_Type ACCOUNT
```
**Output:**  

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

### `Disable-DSLDAPS`
<a name="directory-service_DisableLDAPS_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menonaktifkan panggilan aman LDAP untuk direktori yang ditentukan.**  

```
Disable-DSLDAPS -DirectoryId d-123456ijkl -Type Client
```
+  Untuk detail API, lihat [menonaktifkan DAPS di Referensi Alat AWS untuk PowerShell](https://docs.aws.amazon.com/powershell/v5/reference) *Cmdlet* (V5). 

### `Disable-DSRadius`
<a name="directory-service_DisableRadius_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menonaktifkan server RADIUS yang dikonfigurasi untuk direktori AD Connector atau Microsoft AD.**  

```
Disable-DSRadius -DirectoryId d-123456ijkl
```
+  Untuk detail API, lihat [DisableRadius](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Disable-DSSso`
<a name="directory-service_DisableSso_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menonaktifkan sistem masuk tunggal untuk sebuah direktori.**  

```
Disable-DSSso -DirectoryId d-123456ijkl
```
+  Untuk detail API, lihat [DisableSso](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Enable-DSDirectoryShare`
<a name="directory-service_ShareDirectory_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membagikan direktori tertentu di AWS akun Anda dengan AWS Akun lain menggunakan metode Handshake.**  

```
Enable-DSDirectoryShare -DirectoryId d-123456ijkl -ShareTarget_Id 123456784321 -ShareMethod HANDSHAKE -ShareTarget_Type ACCOUNT
```
**Output:**  

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

### `Enable-DSLDAPS`
<a name="directory-service_EnableLDAPS_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengaktifkan sakelar untuk direktori tertentu agar selalu menggunakan panggilan aman LDAP.**  

```
Enable-DSLDAPS -DirectoryId d-123456ijkl -Type Client
```
+  Untuk detail API, lihat [EnablelDAPS](https://docs.aws.amazon.com/powershell/v5/reference) di Referensi *Alat AWS untuk PowerShell Cmdlet* (V5). 

### `Enable-DSRadius`
<a name="directory-service_EnableRadius_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memungkinkan otentikasi multi-faktor (MFA) dengan konfigurasi server RADIUS yang disediakan untuk Konektor AD atau direktori Microsoft AD.**  

```
Enable-DSRadius -DirectoryId d-123456ijkl 
-RadiusSettings_AuthenticationProtocol PAP 
-RadiusSettings_DisplayLabel Radius 
-RadiusSettings_RadiusPort 1812 
-RadiusSettings_RadiusRetry 4 
-RadiusSettings_RadiusServer 10.4.185.113 
-RadiusSettings_RadiusTimeout 50 
-RadiusSettings_SharedSecret wJalrXUtnFEMI
```
+  Untuk detail API, lihat [EnableRadius](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Enable-DSSso`
<a name="directory-service_EnableSso_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memungkinkan sistem masuk tunggal untuk sebuah direktori.**  

```
Enable-DSSso -DirectoryId d-123456ijkl
```
+  Untuk detail API, lihat [EnableSso](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSCertificate`
<a name="directory-service_DescribeCertificate_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan informasi tentang sertifikat yang terdaftar untuk koneksi LDAP yang aman.**  

```
Get-DSCertificate -DirectoryId d-123456ijkl -CertificateId c-906731e34f
```
**Output:**  

```
CertificateId      : c-906731e34f
CommonName         : contoso-EC2AMAZ-CTGG2NM-CA
ExpiryDateTime     : 4/15/2025 6:34:15 PM
RegisteredDateTime : 4/15/2020 6:38:56 PM
State              : Registered
StateReason        : Certificate registered successfully.
```
+  Untuk detail API, lihat [DescribeCertificate](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSCertificateList`
<a name="directory-service_ListCertificates_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mencantumkan semua sertifikat yang terdaftar untuk koneksi LDAP aman untuk direktori tertentu.**  

```
Get-DSCertificateList -DirectoryId d-123456ijkl
```
**Output:**  

```
CertificateId CommonName                 ExpiryDateTime       State
------------- ----------                 --------------       -----
c-906731e34f  contoso-EC2AMAZ-CTGG2NM-CA 4/15/2025 6:34:15 PM Registered
```
+  Untuk detail API, lihat [ListCertificates](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSConditionalForwarder`
<a name="directory-service_DescribeConditionalForwarders_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mendapatkan semua Forwarder Bersyarat yang dikonfigurasi dari ID Direktori yang diberikan.**  

```
Get-DSConditionalForwarder -DirectoryId d-123456ijkl
```
**Output:**  

```
DnsIpAddrs      RemoteDomainName ReplicationScope
----------      ---------------- ----------------
{172.31.77.239} contoso.com      Domain
```
+  Untuk detail API, lihat [DescribeConditionalForwarders](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSDirectory`
<a name="directory-service_DescribeDirectories_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini Memperoleh informasi tentang direktori milik akun ini.**  

```
Get-DSDirectory | Select-Object DirectoryId, Name, DnsIpAddrs, Type
```
**Output:**  

```
DirectoryId  Name           DnsIpAddrs                     Type
-----------  ----           ----------                     ----
d-123456abcd abcd.example.com {172.31.74.189, 172.31.13.145} SimpleAD
d-123456efgh wifi.example.com {172.31.16.108, 172.31.10.56}  ADConnector
d-123456ijkl lan2.example.com {172.31.10.56, 172.31.16.108}  MicrosoftAD
```
+  Untuk detail API, lihat [DescribeDirectories](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSDirectoryLimit`
<a name="directory-service_GetDirectoryLimits_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghilangkan informasi batas direktori untuk wilayah us-east-1.**  

```
Get-DSDirectoryLimit -Region us-east-1
```
**Output:**  

```
CloudOnlyDirectoriesCurrentCount : 1
CloudOnlyDirectoriesLimit        : 10
CloudOnlyDirectoriesLimitReached : False
CloudOnlyMicrosoftADCurrentCount : 1
CloudOnlyMicrosoftADLimit        : 20
CloudOnlyMicrosoftADLimitReached : False
ConnectedDirectoriesCurrentCount : 1
ConnectedDirectoriesLimit        : 10
```
+  Untuk detail API, lihat [GetDirectoryLimits](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSDomainControllerList`
<a name="directory-service_DescribeDomainControllers_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mendapatkan daftar rinci Pengontrol Domain yang diluncurkan untuk direktori-id yang disebutkan**  

```
Get-DSDomainControllerList -DirectoryId d-123456ijkl
```
**Output:**  

```
AvailabilityZone          : us-east-1b
DirectoryId               : d-123456ijkl
DnsIpAddr                 : 172.31.16.108
DomainControllerId        : dc-1234567aa6
LaunchTime                : 4/4/2019 4:53:43 AM
Status                    : Active
StatusLastUpdatedDateTime : 4/24/2019 1:37:54 PM
StatusReason              :
SubnetId                  : subnet-1234kkaa
VpcId                     : vpc-123459d

AvailabilityZone          : us-east-1d
DirectoryId               : d-123456ijkl
DnsIpAddr                 : 172.31.10.56
DomainControllerId        : dc-1234567aa7
LaunchTime                : 4/4/2019 4:53:43 AM
Status                    : Active
StatusLastUpdatedDateTime : 4/4/2019 5:14:31 AM
StatusReason              :
SubnetId                  : subnet-5678ffbb
VpcId                     : vpc-123459d
```
+  Untuk detail API, lihat [DescribeDomainControllers](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSEventTopic`
<a name="directory-service_DescribeEventTopics_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini menunjukkan informasi Topik SNS yang dikonfigurasi untuk pemberitahuan sementara status direktori berubah.**  

```
Get-DSEventTopic -DirectoryId d-123456ijkl
```
**Output:**  

```
CreatedDateTime : 12/13/2019 11:15:32 AM
DirectoryId     : d-123456ijkl
Status          : Registered
TopicArn        : arn:aws:sns:us-east-1:123456781234:snstopicname
TopicName       : snstopicname
```
+  Untuk detail API, lihat [DescribeEventTopics](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSIpRouteList`
<a name="directory-service_ListIpRoutes_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mendapatkan blok alamat IP publik yang dikonfigurasi di Directory IP Routing**  

```
Get-DSIpRouteList -DirectoryId d-123456ijkl
```
**Output:**  

```
AddedDateTime       : 12/13/2019 12:27:22 PM
CidrIp              : 203.0.113.5/32
Description         : Public IP of On-Prem DNS Server
DirectoryId         : d-123456ijkl
IpRouteStatusMsg    : Added
IpRouteStatusReason :
```
+  Untuk detail API, lihat [ListIpRoutes](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSLDAPSSetting`
<a name="directory-service_DescribeLDAPSSettings_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menjelaskan status keamanan LDAP untuk direktori yang ditentukan.**  

```
Get-DSLDAPSSetting -DirectoryId d-123456ijkl
```
**Output:**  

```
LastUpdatedDateTime  LDAPSStatus LDAPSStatusReason
-------------------  ----------- -----------------
4/15/2020 6:51:03 PM Enabled     LDAPS is enabled successfully.
```
+  Untuk detail API, lihat [Menjelaskan LDAPSSettings](https://docs.aws.amazon.com/powershell/v5/reference) dalam *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSLogSubscriptionList`
<a name="directory-service_ListLogSubscriptions_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mendapatkan informasi log langganan direktori-id tertentu**  

```
Get-DSLogSubscriptionList -DirectoryId d-123456ijkl
```
**Output:**  

```
DirectoryId  LogGroupName                                        SubscriptionCreatedDateTime
-----------  ------------                                        ---------------------------
d-123456ijkl /aws/directoryservice/d-123456ijkl-lan2.example.com 12/14/2019 9:05:23 AM
```
+  Untuk detail API, lihat [ListLogSubscriptions](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSResourceTag`
<a name="directory-service_ListTagsForResource_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mendapatkan semua Tag Direktori tertentu.**  

```
Get-DSResourceTag -ResourceId d-123456ijkl
```
**Output:**  

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

### `Get-DSSchemaExtension`
<a name="directory-service_ListSchemaExtensions_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mencantumkan semua ekstensi skema yang diterapkan ke Direktori Microsoft AD.**  

```
Get-DSSchemaExtension -DirectoryId d-123456ijkl
```
**Output:**  

```
Description                 : ManagedADSchemaExtension
DirectoryId                 : d-123456ijkl
EndDateTime                 : 4/12/2020 10:30:49 AM
SchemaExtensionId           : e-9067306643
SchemaExtensionStatus       : Completed
SchemaExtensionStatusReason : Schema updates are complete.
StartDateTime               : 4/12/2020 10:28:42 AM
```
+  Untuk detail API, lihat [ListSchemaExtensions](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSSharedDirectory`
<a name="directory-service_DescribeSharedDirectories_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan direktori bersama Akun Anda AWS **  

```
Get-DSSharedDirectory -OwnerDirectoryId d-123456ijkl -SharedDirectoryId d-9067012345
```
**Output:**  

```
CreatedDateTime     : 12/30/2019 4:34:37 AM
LastUpdatedDateTime : 12/30/2019 4:35:22 AM
OwnerAccountId      : 123456781234
OwnerDirectoryId    : d-123456ijkl
SharedAccountId     : 123456784321
SharedDirectoryId   : d-9067012345
ShareMethod         : HANDSHAKE
ShareNotes          : This is a test Sharing
ShareStatus         : Shared
```
+  Untuk detail API, lihat [DescribeSharedDirectories](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSSnapshot`
<a name="directory-service_DescribeSnapshots_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mendapatkan informasi tentang snapshot direktori tertentu milik akun ini.**  

```
Get-DSSnapshot -DirectoryId d-123456ijkl
```
**Output:**  

```
DirectoryId : d-123456ijkl
Name        :
SnapshotId  : s-9064bd1234
StartTime   : 12/13/2019 6:33:01 PM
Status      : Completed
Type        : Auto

DirectoryId : d-123456ijkl
Name        :
SnapshotId  : s-9064bb4321
StartTime   : 12/9/2019 9:48:11 PM
Status      : Completed
Type        : Auto
```
+  Untuk detail API, lihat [DescribeSnapshots](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSSnapshotLimit`
<a name="directory-service_GetSnapshotLimits_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mendapatkan batas snapshot manual untuk direktori tertentu.**  

```
Get-DSSnapshotLimit -DirectoryId d-123456ijkl
```
**Output:**  

```
ManualSnapshotsCurrentCount ManualSnapshotsLimit ManualSnapshotsLimitReached
--------------------------- -------------------- ---------------------------
0                           5                    False
```
+  Untuk detail API, lihat [GetSnapshotLimits](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Get-DSTrust`
<a name="directory-service_DescribeTrusts_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini mendapatkan informasi hubungan kepercayaan yang dibuat untuk direktori-id tertentu.**  

```
Get-DSTrust -DirectoryId d-123456abcd
```
**Output:**  

```
CreatedDateTime          : 7/5/2019 4:55:42 AM
DirectoryId              : d-123456abcd
LastUpdatedDateTime      : 7/5/2019 4:56:04 AM
RemoteDomainName         : contoso.com
SelectiveAuth            : Disabled
StateLastUpdatedDateTime : 7/5/2019 4:56:04 AM
TrustDirection           : One-Way: Incoming
TrustId                  : t-9067157123
TrustState               : Created
TrustStateReason         :
TrustType                : Forest
```
+  Untuk detail API, lihat [DescribeTrusts](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-DSAlias`
<a name="directory-service_CreateAlias_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini membuat alias untuk direktori dan menetapkan alias ke direktori-id yang ditentukan.**  

```
New-DSAlias -DirectoryId d-123456ijkl -Alias MyOrgName
```
**Output:**  

```
Alias     DirectoryId
-----     -----------
myorgname d-123456ijkl
```
+  Untuk detail API, lihat [CreateAlias](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-DSComputer`
<a name="directory-service_CreateComputer_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat objek komputer Active Directory baru.**  

```
New-DSComputer -DirectoryId d-123456ijkl -ComputerName ADMemberServer -Password $Password
```
**Output:**  

```
ComputerAttributes                  ComputerId                                    ComputerName
------------------                  ----------                                    ------------
{WindowsSamName, DistinguishedName} S-1-5-21-1191241402-978882507-2717148213-1662 ADMemberServer
```
+  Untuk detail API, lihat [CreateComputer](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-DSConditionalForwarder`
<a name="directory-service_CreateConditionalForwarder_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat kondisional forwarder di direktori-ID tertentu. AWS **  

```
New-DSConditionalForwarder -DirectoryId d-123456ijkl -DnsIpAddr 172.31.36.96,172.31.10.56 -RemoteDomainName contoso.com
```
+  Untuk detail API, lihat [CreateConditionalForwarder](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-DSDirectory`
<a name="directory-service_CreateDirectory_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat direktori Simple AD baru.**  

```
New-DSDirectory -Name corp.example.com -Password $Password -Size Small -VpcSettings_VpcId vpc-123459d -VpcSettings_SubnetIds subnet-1234kkaa,subnet-5678ffbb
```
+  Untuk detail API, lihat [CreateDirectory](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-DSLogSubscription`
<a name="directory-service_CreateLogSubscription_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat langganan untuk meneruskan log keamanan pengontrol domain Directory Service real-time ke grup log Amazon yang ditentukan di grup CloudWatch log Amazon Anda Akun AWS.**  

```
New-DSLogSubscription -DirectoryId d-123456ijkl -LogGroupName /aws/directoryservice/d-123456ijkl-lan2.example.com
```
+  Untuk detail API, lihat [CreateLogSubscription](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-DSMicrosoftAD`
<a name="directory-service_CreateMicrosoftAD_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat Direktori Microsoft AD baru di AWS Cloud.**  

```
New-DSMicrosoftAD -Name corp.example.com -Password $Password -edition Standard -VpcSettings_VpcId vpc-123459d -VpcSettings_SubnetIds subnet-1234kkaa,subnet-5678ffbb
```
+  Untuk detail API, lihat [CreateMicrosoftAD](https://docs.aws.amazon.com/powershell/v5/reference) di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-DSSnapshot`
<a name="directory-service_CreateSnapshot_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat snapshot direktori**  

```
New-DSSnapshot -DirectoryId d-123456ijkl
```
+  Untuk detail API, lihat [CreateSnapshot](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `New-DSTrust`
<a name="directory-service_CreateTrust_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menciptakan kepercayaan Two-Way Forestwide antara direktori AD AWS Microsoft Terkelola, dan Microsoft Active Directory lokal yang ada.**  

```
New-DSTrust -DirectoryId d-123456ijkl -RemoteDomainName contoso.com -TrustDirection Two-Way -TrustType Forest -TrustPassword $Password -ConditionalForwarderIpAddr 172.31.36.96
```
**Output:**  

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

### `Register-DSCertificate`
<a name="directory-service_RegisterCertificate_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendaftarkan sertifikat untuk koneksi LDAP yang aman.**  

```
$Certificate = Get-Content contoso.cer -Raw
Register-DSCertificate -DirectoryId d-123456ijkl -CertificateData $Certificate
```
**Output:**  

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

### `Register-DSEventTopic`
<a name="directory-service_RegisterEventTopic_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengaitkan direktori sebagai penerbit dengan topik SNS.**  

```
Register-DSEventTopic -DirectoryId d-123456ijkl -TopicName snstopicname
```
+  Untuk detail API, lihat [RegisterEventTopic](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-DSConditionalForwarder`
<a name="directory-service_DeleteConditionalForwarder_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus forwarder bersyarat yang telah disiapkan untuk Direcotry Anda. AWS **  

```
Remove-DSConditionalForwarder -DirectoryId d-123456ijkl -RemoteDomainName contoso.com
```
+  Untuk detail API, lihat [DeleteConditionalForwarder](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-DSDirectory`
<a name="directory-service_DeleteDirectory_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus AWS direktori layanan Direktori (Konektor AD/Microsoft AD/AD Sederhana)**  

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

### `Remove-DSIpRoute`
<a name="directory-service_RemoveIpRoutes_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini menghapus IP yang ditentukan dari rute IP Dikonfigurasi dari ID Direktori.**  

```
Remove-DSIpRoute -DirectoryId d-123456ijkl -CidrIp 203.0.113.5/32
```
+  Untuk detail API, lihat [RemoveIpRoutes](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-DSLogSubscription`
<a name="directory-service_DeleteLogSubscription_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini menghapus Langganan Log dari ID Direktori yang ditentukan**  

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

### `Remove-DSResourceTag`
<a name="directory-service_RemoveTagsFromResource_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Perintah ini menghapus Tag Sumber Daya yang ditetapkan ke ID Direktori yang ditentukan**  

```
Remove-DSResourceTag -ResourceId d-123456ijkl -TagKey myTag
```
+  Untuk detail API, lihat [RemoveTagsFromResource](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Remove-DSSnapshot`
<a name="directory-service_DeleteSnapshot_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus snapshot yang dibuat secara manual.**  

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

### `Remove-DSTrust`
<a name="directory-service_DeleteTrust_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus hubungan kepercayaan yang ada antara Direktori AD AWS Terkelola dan domain eksternal.**  

```
Get-DSTrust -DirectoryId d-123456ijkl -Select Trusts.TrustId | Remove-DSTrust
```
**Output:**  

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

### `Reset-DSUserPassword`
<a name="directory-service_ResetUserPassword_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Reset-DSUserPassword`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengatur ulang kata sandi pengguna Active Direcotry yang dinamai ADUser di Microsoft AD yang AWS dikelola atau Simple AD Directory**  

```
Reset-DSUserPassword -UserName ADuser -DirectoryId d-123456ijkl -NewPassword $Password
```
+  Untuk detail API, lihat [ResetUserPassword](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Restore-DSFromSnapshot`
<a name="directory-service_RestoreFromSnapshot_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Restore-DSFromSnapshot`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengembalikan direktori menggunakan snapshot direktori yang ada.**  

```
Restore-DSFromSnapshot -SnapshotId s-9068b488kc
```
+  Untuk detail API, lihat [RestoreFromSnapshot](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Set-DSDomainControllerCount`
<a name="directory-service_UpdateNumberOfDomainControllers_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menetapkan jumlah pengontrol domain ke 3 untuk direktori-id tertentu.**  

```
Set-DSDomainControllerCount -DirectoryId d-123456ijkl -DesiredNumber 3
```
+  Untuk detail API, lihat [UpdateNumberOfDomainControllers](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Start-DSSchemaExtension`
<a name="directory-service_StartSchemaExtension_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Start-DSSchemaExtension`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini Menerapkan ekstensi skema ke direktori Microsoft AD.**  

```
$ldif = Get-Content D:\Users\Username\Downloads\ExtendedSchema.ldf -Raw
Start-DSSchemaExtension -DirectoryId d-123456ijkl -CreateSnapshotBeforeSchemaExtension $true -Description ManagedADSchemaExtension -LdifContent $ldif
```
**Output:**  

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

### `Stop-DSSchemaExtension`
<a name="directory-service_CancelSchemaExtension_powershell_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`Stop-DSSchemaExtension`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membatalkan ekstensi skema yang sedang berlangsung ke direktori Microsoft AD.**  

```
Stop-DSSchemaExtension -DirectoryId d-123456ijkl -SchemaExtensionId e-9067306643
```
+  Untuk detail API, lihat [CancelSchemaExtension](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Unregister-DSCertificate`
<a name="directory-service_DeregisterCertificate_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus dari sistem sertifikat yang terdaftar untuk koneksi LDAP yang aman..**  

```
Unregister-DSCertificate -DirectoryId d-123456ijkl -CertificateId c-906731e34f
```
+  Untuk detail API, lihat [DeregisterCertificate](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Unregister-DSEventTopic`
<a name="directory-service_DeregisterEventTopic_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus direktori specefied sebagai penerbit ke topik SNS yang ditentukan.**  

```
Unregister-DSEventTopic -DirectoryId d-123456ijkl -TopicName snstopicname
```
+  Untuk detail API, lihat [DeregisterEventTopic](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-DSConditionalForwarder`
<a name="directory-service_UpdateConditionalForwarder_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui forwarder bersyarat yang telah disiapkan untuk direktori Anda. AWS **  

```
Update-DSConditionalForwarder -DirectoryId d-123456ijkl -DnsIpAddr 172.31.36.96,172.31.16.108 -RemoteDomainName contoso.com
```
+  Untuk detail API, lihat [UpdateConditionalForwarder](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-DSRadius`
<a name="directory-service_UpdateRadius_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui informasi server RADIUS untuk direktori AD Connector atau Microsoft AD.**  

```
Update-DSRadius -DirectoryId d-123456ijkl -RadiusSettings_RadiusRetry 3
```
+  Untuk detail API, lihat [UpdateRadius](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

### `Update-DSTrust`
<a name="directory-service_UpdateTrust_powershell_topic"></a>

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

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui SelectiveAuth parameter trust-id tertentu dari Disabled ke Enabled.**  

```
Update-DSTrust -TrustId t-9067157123 -SelectiveAuth Enabled
```
**Output:**  

```
RequestId                            TrustId
---------                            -------
138864a7-c9a8-4ad1-a828-eae479e85b45 t-9067157123
```
+  Untuk detail API, lihat [UpdateTrust](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 