View a markdown version of this page

Directory Service contoh menggunakan Tools for PowerShell V5 - Alat AWS untuk PowerShell (versi 5)

Versi 5 (V5) Alat AWS untuk PowerShell telah dirilis!

Untuk informasi tentang mengubah perubahan dan memigrasikan aplikasi Anda, lihat topik https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html migrasi.

Orange button with text "Click here for details".

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

Directory Service contoh menggunakan Tools for PowerShell V5

Contoh kode berikut menunjukkan cara melakukan tindakan dan menerapkan 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.

Tindakan

Contoh kode berikut menunjukkan cara menggunakanAdd-DSIpRoute.

Alat untuk PowerShell V5

Contoh 1: Perintah ini menghapus Tag Sumber Daya yang ditetapkan ke yang ditentukan Directory-id

Add-DSIpRoute -DirectoryId d-123456ijkl -IpRoute @{CidrIp ="203.0.113.5/32"} -UpdateSecurityGroupForDirectoryController $true
  • Untuk detail API, lihat AddIpRoutes di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanAdd-DSResourceTag.

Alat untuk PowerShell V5

Contoh 1: Perintah ini menambahkan Tag Sumber Daya ke yang ditentukan Directory-id

Add-DSResourceTag -ResourceId d-123456ijkl -Tag @{Key="myTag"; Value="mytgValue"}
  • Untuk detail API, lihat AddTagsToResource di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanApprove-DSTrust.

Alat untuk PowerShell V5

Contoh 1: Contoh ini memanggil operasi VerifyTrust API Layanan AWS Direktori untuk Trustid tertentu.

Approve-DSTrust -TrustId t-9067157123
  • Untuk detail API, lihat VerifyTrust di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanConfirm-DSSharedDirectory.

Alat untuk PowerShell V5

Contoh 1: Contoh ini menerima permintaan berbagi direktori yang dikirim dari pemilik direktori Akun AWS.

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

Contoh kode berikut menunjukkan cara menggunakanConnect-DSDirectory.

Alat untuk PowerShell V5

Contoh 1: Contoh ini membuat Konektor AD 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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanDeny-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

Contoh kode berikut menunjukkan cara menggunakanDisable-DSDirectoryShare.

Alat untuk PowerShell V5

Contoh 1: Contoh ini menghentikan berbagi 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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanDisable-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 DisableLDAPS di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanDisable-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanDisable-DSSso.

Alat untuk PowerShell V5

Contoh 1: Contoh ini menonaktifkan single sign-on untuk direktori.

Disable-DSSso -DirectoryId d-123456ijkl
  • Untuk detail API, lihat DisableSso di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanEnable-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanEnable-DSLDAPS.

Alat untuk PowerShell V5

Contoh 1: Contoh ini mengaktifkan sakelar untuk direktori tertentu untuk selalu menggunakan panggilan aman LDAP.

Enable-DSLDAPS -DirectoryId d-123456ijkl -Type Client
  • Untuk detail API, lihat EnableLDAPS di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanEnable-DSRadius.

Alat untuk PowerShell V5

Contoh 1: Contoh ini mengaktifkan otentikasi multi-faktor (MFA) dengan konfigurasi server RADIUS yang disediakan untuk direktori AD Connector atau 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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanEnable-DSSso.

Alat untuk PowerShell V5

Contoh 1: Contoh ini mengaktifkan single sign-on untuk direktori.

Enable-DSSso -DirectoryId d-123456ijkl
  • Untuk detail API, lihat EnableSso di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanGet-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.

Contoh kode berikut menunjukkan cara menggunakanGet-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanGet-DSConditionalForwarder.

Alat untuk PowerShell V5

Contoh 1: Perintah ini mendapatkan semua Forwarder Bersyarat yang dikonfigurasi yang diberikan Directory-id.

Get-DSConditionalForwarder -DirectoryId d-123456ijkl

Output:

DnsIpAddrs RemoteDomainName ReplicationScope ---------- ---------------- ---------------- {172.31.77.239} contoso.com Domain

Contoh kode berikut menunjukkan cara menggunakanGet-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

Contoh kode berikut menunjukkan cara menggunakanGet-DSDirectoryLimit.

Alat untuk PowerShell V5

Contoh 1: Contoh ini menampilkan 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

Contoh kode berikut menunjukkan cara menggunakanGet-DSDomainControllerList.

Alat untuk PowerShell V5

Contoh 1: Perintah ini mendapatkan daftar rinci Pengontrol Domain yang diluncurkan untuk id direktori 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

Contoh kode berikut menunjukkan cara menggunakanGet-DSEventTopic.

Alat untuk PowerShell V5

Contoh 1: Perintah ini menunjukkan informasi Topik SNS yang dikonfigurasi untuk pemberitahuan saat 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

Contoh kode berikut menunjukkan cara menggunakanGet-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanGet-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 Deskripsi DapsSettings di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanGet-DSLogSubscriptionList.

Alat untuk PowerShell V5

Contoh 1: Perintah ini mendapatkan informasi langganan log dari direktori-id yang ditentukan

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

Contoh kode berikut menunjukkan cara menggunakanGet-DSResourceTag.

Alat untuk PowerShell V5

Contoh 1: Perintah ini mendapatkan semua Tag dari Direktori yang ditentukan.

Get-DSResourceTag -ResourceId d-123456ijkl

Output:

Key Value --- ----- myTag myTagValue

Contoh kode berikut menunjukkan cara menggunakanGet-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

Contoh kode berikut menunjukkan cara menggunakanGet-DSSharedDirectory.

Alat untuk PowerShell V5

Contoh 1: Contoh ini mendapatkan direktori bersama AWS Akun Anda

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

Contoh kode berikut menunjukkan cara menggunakanGet-DSSnapshot.

Alat untuk PowerShell V5

Contoh 1: Perintah ini mendapatkan informasi tentang snapshot direktori yang ditentukan 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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanGet-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanGet-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanNew-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanNew-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanNew-DSConditionalForwarder.

Alat untuk PowerShell V5

Contoh 1: Contoh ini membuat forwarder bersyarat dalam yang ditentukan AWS Directory-id.

New-DSConditionalForwarder -DirectoryId d-123456ijkl -DnsIpAddr 172.31.36.96,172.31.10.56 -RemoteDomainName contoso.com

Contoh kode berikut menunjukkan cara menggunakanNew-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanNew-DSLogSubscription.

Alat untuk PowerShell V5

Contoh 1: Contoh ini membuat langganan untuk meneruskan log keamanan pengontrol domain Layanan Direktori real-time ke grup CloudWatch log Amazon tertentu di Anda Akun AWS.

New-DSLogSubscription -DirectoryId d-123456ijkl -LogGroupName /aws/directoryservice/d-123456ijkl-lan2.example.com

Contoh kode berikut menunjukkan cara menggunakanNew-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

Contoh kode berikut menunjukkan cara menggunakanNew-DSSnapshot.

Alat untuk PowerShell V5

Contoh 1: Contoh ini membuat snapshot direktori

New-DSSnapshot -DirectoryId d-123456ijkl
  • Untuk detail API, lihat CreateSnapshot di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanNew-DSTrust.

Alat untuk PowerShell V5

Contoh 1: Contoh ini membuat kepercayaan Two-Way Forestwide antara direktori Microsoft AD Ter AWS kelola Anda, dan Direktori Aktif Microsoft 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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanRegister-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

Contoh kode berikut menunjukkan cara menggunakanRegister-DSEventTopic.

Alat untuk PowerShell V5

Contoh 1: Contoh ini mengaitkan direktori sebagai penerbit dengan topik SNS.

Register-DSEventTopic -DirectoryId d-123456ijkl -TopicName snstopicname

Contoh kode berikut menunjukkan cara menggunakanRemove-DSConditionalForwarder.

Alat untuk PowerShell V5

Contoh 1: Contoh ini menghapus forwarder bersyarat yang telah diatur untuk AWS Direcotry Anda.

Remove-DSConditionalForwarder -DirectoryId d-123456ijkl -RemoteDomainName contoso.com

Contoh kode berikut menunjukkan cara menggunakanRemove-DSDirectory.

Alat untuk PowerShell V5

Contoh 1: Contoh ini menghapus AWS direktori layanan Direktori ( AD/Microsoft AD/AD Konektor Sederhana)

Remove-DSDirectory -DirectoryId d-123456ijkl
  • Untuk detail API, lihat DeleteDirectory di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanRemove-DSIpRoute.

Alat untuk PowerShell V5

Contoh 1: Perintah ini menghapus IP yang ditentukan dari rute IP yang dikonfigurasi Directory-id.

Remove-DSIpRoute -DirectoryId d-123456ijkl -CidrIp 203.0.113.5/32
  • Untuk detail API, lihat RemoveIpRoutes di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanRemove-DSLogSubscription.

Alat untuk PowerShell V5

Contoh 1: Perintah ini menghapus Log Subscription dari yang ditentukan Directory-id

Remove-DSLogSubscription -DirectoryId d-123456ijkl

Contoh kode berikut menunjukkan cara menggunakanRemove-DSResourceTag.

Alat untuk PowerShell V5

Contoh 1: Perintah ini menghapus Tag Sumber Daya yang ditetapkan ke yang ditentukan Directory-id

Remove-DSResourceTag -ResourceId d-123456ijkl -TagKey myTag

Contoh kode berikut menunjukkan cara menggunakanRemove-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanRemove-DSTrust.

Alat untuk PowerShell V5

Contoh 1: Contoh ini menghapus hubungan kepercayaan yang ada antara Direktori AD Terkel AWS ola dan domain eksternal.

Get-DSTrust -DirectoryId d-123456ijkl -Select Trusts.TrustId | Remove-DSTrust

Output:

t-9067157123
  • Untuk detail API, lihat DeleteTrust di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanReset-DSUserPassword.

Alat untuk PowerShell V5

Contoh 1: Contoh ini mengatur ulang kata sandi pengguna Active Direcotry bernama AdUser di Managed microsoft AD atau Direktori AD AWS Sederhana

Reset-DSUserPassword -UserName ADuser -DirectoryId d-123456ijkl -NewPassword $Password
  • Untuk detail API, lihat ResetUserPassword di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanRestore-DSFromSnapshot.

Alat untuk PowerShell V5

Contoh 1: Contoh ini mengembalikan direktori menggunakan snapshot direktori yang ada.

Restore-DSFromSnapshot -SnapshotId s-9068b488kc

Contoh kode berikut menunjukkan cara menggunakanSet-DSDomainControllerCount.

Alat untuk PowerShell V5

Contoh 1: Contoh ini menetapkan jumlah pengontrol domain ke 3 untuk direktori-id yang ditentukan.

Set-DSDomainControllerCount -DirectoryId d-123456ijkl -DesiredNumber 3

Contoh kode berikut menunjukkan cara menggunakanStart-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

Contoh kode berikut menunjukkan cara menggunakanStop-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

Contoh kode berikut menunjukkan cara menggunakanUnregister-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

Contoh kode berikut menunjukkan cara menggunakanUnregister-DSEventTopic.

Alat untuk PowerShell V5

Contoh 1: Contoh ini menghapus direktori tertentu sebagai penerbit ke topik SNS yang ditentukan.

Unregister-DSEventTopic -DirectoryId d-123456ijkl -TopicName snstopicname

Contoh kode berikut menunjukkan cara menggunakanUpdate-DSConditionalForwarder.

Alat untuk PowerShell V5

Contoh 1: Contoh ini memperbarui forwarder bersyarat yang telah diatur untuk AWS direktori Anda.

Update-DSConditionalForwarder -DirectoryId d-123456ijkl -DnsIpAddr 172.31.36.96,172.31.16.108 -RemoteDomainName contoso.com

Contoh kode berikut menunjukkan cara menggunakanUpdate-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Contoh kode berikut menunjukkan cara menggunakanUpdate-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).