Skip to content

Commit

Permalink
Update New-AzADDomainService.md (#18102)
Browse files Browse the repository at this point in the history
* Update New-AzADDomainService.md

* Update New-AzADDomainService.md
  • Loading branch information
BethanyZhou authored May 12, 2022
1 parent 5a42518 commit 9f76a2d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/ADDomainServices/examples/New-AzADDomainService.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,20 @@ youriADdomain youriAddomain.com westus Enterprise

Create new ADDomainService

### Example 2: Create new ADDomainService with certificate
```powershell
# Variables
$replicaSet = New-AzADDomainServiceReplicaSet -Location westus -SubnetId /subscriptions/********-****-****-****-**********/resourceGroups/yishitest/providers/Microsoft.Network/virtualNetworks/aadds-vnet/subnets/default\
$certificateBytes = get-content "certificate.pfx" -AsByteStream
$base64String = [System.Convert]::ToBase64String($certificateBytes)
$ldaps_pfx_pass = "MyStrongPassword"
New-AzADDomainService -name youriADdomain -ResourceGroupName youriAddomain -DomainName youriAddomain.com -ReplicaSet $replicaSet -LdapSettingLdaps Enabled -LdapSettingPfxCertificate $base64String -LdapSettingPfxCertificatePassword $($ldaps_pfx_pass | ConvertTo-SecureString -Force -AsPlainText)
```

```output
Name Domain Name Location Sku
---- ----------- -------- ---
youriADdomain youriAddomain.com westus Enterprise
```

Create new ADDomainService with certificate
18 changes: 18 additions & 0 deletions src/ADDomainServices/help/New-AzADDomainService.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,24 @@ youriADdomain youriAddomain.com westus Enterprise

Create new ADDomainService

### Example 2: Create new ADDomainService with certificate
```powershell
# Variables
$replicaSet = New-AzADDomainServiceReplicaSet -Location westus -SubnetId /subscriptions/********-****-****-****-**********/resourceGroups/yishitest/providers/Microsoft.Network/virtualNetworks/aadds-vnet/subnets/default\
$certificateBytes = get-content "certificate.pfx" -AsByteStream
$base64String = [System.Convert]::ToBase64String($certificateBytes)
$ldaps_pfx_pass = "MyStrongPassword"
New-AzADDomainService -name youriADdomain -ResourceGroupName youriAddomain -DomainName youriAddomain.com -ReplicaSet $replicaSet -LdapSettingLdaps Enabled -LdapSettingPfxCertificate $base64String -LdapSettingPfxCertificatePassword $($ldaps_pfx_pass | ConvertTo-SecureString -Force -AsPlainText)
```

```output
Name Domain Name Location Sku
---- ----------- -------- ---
youriADdomain youriAddomain.com westus Enterprise
```

Create new ADDomainService with certificate

## PARAMETERS

### -AsJob
Expand Down

0 comments on commit 9f76a2d

Please sign in to comment.