1616
1717<#
1818. Synopsis
19- The Create Domain Service operation creates a new domain service with the specified parameters.
19+ The create Domain Service operation create a new domain service with the specified parameters.
2020If the specific service already exists, then any patchable properties will be updated and any immutable properties will remain unchanged.
2121. Description
22- The Create Domain Service operation creates a new domain service with the specified parameters.
22+ The create Domain Service operation create a new domain service with the specified parameters.
2323If the specific service already exists, then any patchable properties will be updated and any immutable properties will remain unchanged.
2424. Example
2525$replicaSet = New-AzADDomainServiceReplicaSetObject -Location westus -SubnetId /subscriptions/********-****-****-****-**********/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default
26- New-AzADDomainService -name youriADdomain -ResourceGroupName youriAddomain -DomainName youriAddomain.com -ReplicaSet $replicaSet
26+ New-AzADDomainService -Name youriADdomain -ResourceGroupName youriAddomain -DomainName youriAddomain.com -ReplicaSet $replicaSet
27+ . Example
28+ # Variables
29+ $replicaSet = New-AzADDomainServiceReplicaSet -Location westus -SubnetId /subscriptions/********-****-****-****-**********/resourceGroups/yishitest/providers/Microsoft.Network/virtualNetworks/aadds-vnet/subnets/default\
30+ $certificateBytes = Get-Content "certificate.pfx" -AsByteStream
31+ $base64String = [System.Convert]::ToBase64String($certificateBytes)
32+ $ldaps_pfx_pass = "MyStrongPassword"
33+
34+ New-AzADDomainService -Name youriADdomain -ResourceGroupName youriAddomain -DomainName youriAddomain.com -ReplicaSet $replicaSet -LdapSettingLdaps Enabled -LdapSettingPfxCertificate $base64String -LdapSettingPfxCertificatePassword $($ldaps_pfx_pass | ConvertTo-SecureString -Force -AsPlainText)
2735
2836. Outputs
29- Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001. IDomainService
37+ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.IDomainService
3038. Notes
3139COMPLEX PARAMETER PROPERTIES
3240
@@ -46,189 +54,206 @@ REPLICASET <IReplicaSet[]>: List of ReplicaSets
4654https://learn.microsoft.com/powershell/module/az.addomainservices/new-azaddomainservice
4755#>
4856function New-AzADDomainService {
49- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001. IDomainService ])]
57+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.IDomainService ])]
5058[CmdletBinding (DefaultParameterSetName = ' CreateExpanded' , PositionalBinding = $false , SupportsShouldProcess , ConfirmImpact = ' Medium' )]
5159param (
52- [Parameter (Mandatory )]
60+ [Parameter (ParameterSetName = ' CreateExpanded' , Mandatory )]
61+ [Parameter (ParameterSetName = ' CreateViaJsonFilePath' , Mandatory )]
62+ [Parameter (ParameterSetName = ' CreateViaJsonString' , Mandatory )]
5363 [Alias (' DomainServiceName' )]
5464 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Path' )]
5565 [System.String ]
5666 # The name of the domain service.
5767 ${Name} ,
5868
59- [Parameter (Mandatory )]
69+ [Parameter (ParameterSetName = ' CreateExpanded' , Mandatory )]
70+ [Parameter (ParameterSetName = ' CreateViaJsonFilePath' , Mandatory )]
71+ [Parameter (ParameterSetName = ' CreateViaJsonString' , Mandatory )]
6072 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Path' )]
6173 [System.String ]
6274 # The name of the resource group within the user's subscription.
6375 # The name is case insensitive.
6476 ${ResourceGroupName} ,
6577
66- [Parameter ()]
78+ [Parameter (ParameterSetName = ' CreateExpanded' )]
79+ [Parameter (ParameterSetName = ' CreateViaJsonFilePath' )]
80+ [Parameter (ParameterSetName = ' CreateViaJsonString' )]
6781 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Path' )]
6882 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.DefaultInfo (Script= ' (Get-AzContext).Subscription.Id' )]
6983 [System.String ]
7084 # Gets subscription credentials which uniquely identify the Microsoft Azure subscription.
7185 # The subscription ID forms part of the URI for every service call.
7286 ${SubscriptionId} ,
7387
74- [Parameter ()]
88+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
7589 [ArgumentCompleter ({' FullySynced' , ' ResourceTrusting' })]
7690 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
7791 [System.String ]
7892 # Domain Configuration Type
7993 ${DomainConfigurationType} ,
8094
81- [Parameter (Mandatory )]
95+ [Parameter (ParameterSetName = ' CreateExpanded ' , Mandatory )]
8296 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
8397 [System.String ]
8498 # The name of the Azure domain that the user would like to deploy Domain Services to.
8599 ${DomainName} ,
86100
87- [Parameter ()]
88- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NtlmV1 ] )]
101+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
102+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute ( " Enabled " , " Disabled " )]
89103 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
90- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NtlmV1 ]
104+ [System.String ]
91105 # A flag to determine whether or not NtlmV1 is enabled or disabled.
92106 ${DomainSecuritySettingNtlmV1} ,
93107
94- [Parameter ()]
95- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncKerberosPasswords ] )]
108+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
109+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute ( " Enabled " , " Disabled " )]
96110 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
97- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncKerberosPasswords ]
111+ [System.String ]
98112 # A flag to determine whether or not SyncKerberosPasswords is enabled or disabled.
99113 ${DomainSecuritySettingSyncKerberosPassword} ,
100114
101- [Parameter ()]
102- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncNtlmPasswords ] )]
115+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
116+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute ( " Enabled " , " Disabled " )]
103117 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
104- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncNtlmPasswords ]
118+ [System.String ]
105119 # A flag to determine whether or not SyncNtlmPasswords is enabled or disabled.
106120 ${DomainSecuritySettingSyncNtlmPassword} ,
107121
108- [Parameter ()]
109- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncOnPremPasswords ] )]
122+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
123+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute ( " Enabled " , " Disabled " )]
110124 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
111- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncOnPremPasswords ]
125+ [System.String ]
112126 # A flag to determine whether or not SyncOnPremPasswords is enabled or disabled.
113127 ${DomainSecuritySettingSyncOnPremPassword} ,
114128
115- [Parameter ()]
116- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.TlsV1 ] )]
129+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
130+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute ( " Enabled " , " Disabled " )]
117131 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
118- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.TlsV1 ]
132+ [System.String ]
119133 # A flag to determine whether or not TlsV1 is enabled or disabled.
120134 ${DomainSecuritySettingTlsV1} ,
121135
122- [Parameter ()]
136+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
123137 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
124138 [System.String ]
125139 # Resource etag
126140 ${Etag} ,
127141
128- [Parameter ()]
129- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.FilteredSync ] )]
142+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
143+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute ( " Enabled " , " Disabled " )]
130144 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
131- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.FilteredSync ]
145+ [System.String ]
132146 # Enabled or Disabled flag to turn on Group-based filtered sync
133147 ${FilteredSync} ,
134148
135- [Parameter ()]
149+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
136150 [AllowEmptyCollection ()]
137151 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
138- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001. IForestTrust []]
152+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.IForestTrust []]
139153 # List of settings for Resource Forest
140- # To construct, see NOTES section for FORESTTRUST properties and create a hash table.
141154 ${ForestTrust} ,
142155
143- [Parameter ()]
144- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.ExternalAccess ] )]
156+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
157+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute ( " Enabled " , " Disabled " )]
145158 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
146- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.ExternalAccess ]
159+ [System.String ]
147160 # A flag to determine whether or not Secure LDAP access over the internet is enabled or disabled.
148161 ${LdapSettingExternalAccess} ,
149162
150- [Parameter ()]
151- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.Ldaps ] )]
163+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
164+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute ( " Enabled " , " Disabled " )]
152165 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
153- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.Ldaps ]
166+ [System.String ]
154167 # A flag to determine whether or not Secure LDAP is enabled or disabled.
155168 ${LdapSettingLdaps} ,
156169
157- [Parameter ()]
170+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
158171 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
159172 [System.String ]
160173 # Input File for LdapSettingPfxCertificate (The certificate required to configure Secure LDAP.
161174 # The parameter passed here should be a base64encoded representation of the certificate pfx file.)
162175 ${LdapSettingPfxCertificateInputFile} ,
163176
164- [Parameter ()]
177+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
165178 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
166179 [System.Security.SecureString ]
167180 # The password to decrypt the provided Secure LDAP certificate pfx file.
168181 ${LdapSettingPfxCertificatePassword} ,
169182
170- [Parameter ()]
183+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
171184 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
172185 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.DefaultInfo (Name= ' Location Default' , Description= ' Gets the Location from the first element in ReplicaSets.' , Script= ' $ReplicaSet[0].Location' )]
173186 [System.String ]
174187 # Resource location
175188 ${Location} ,
176189
177- [Parameter ()]
190+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
178191 [AllowEmptyCollection ()]
179192 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
180193 [System.String []]
181194 # The list of additional recipients
182195 ${NotificationSettingAdditionalRecipient} ,
183196
184- [Parameter ()]
185- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NotifyDcAdmins ] )]
197+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
198+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute ( " Enabled " , " Disabled " )]
186199 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
187- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NotifyDcAdmins ]
200+ [System.String ]
188201 # Should domain controller admins be notified
189202 ${NotificationSettingNotifyDcAdmin} ,
190203
191- [Parameter ()]
192- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NotifyGlobalAdmins ] )]
204+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
205+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute ( " Enabled " , " Disabled " )]
193206 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
194- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NotifyGlobalAdmins ]
207+ [System.String ]
195208 # Should global admins be notified
196209 ${NotificationSettingNotifyGlobalAdmin} ,
197210
198- [Parameter (Mandatory )]
211+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
199212 [AllowEmptyCollection ()]
200213 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
201- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001. IReplicaSet []]
214+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.IReplicaSet []]
202215 # List of ReplicaSets
203- # To construct, see NOTES section for REPLICASET properties and create a hash table.
204216 ${ReplicaSet} ,
205217
206- [Parameter ()]
218+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
207219 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
208220 [System.String ]
209221 # Resource Forest
210222 ${ResourceForest} ,
211223
212- [Parameter ()]
224+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
213225 [ArgumentCompleter ({' Standard' , ' Enterprise' , ' Premium' })]
214226 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
215227 [System.String ]
216228 # Sku Type
217229 ${Sku} ,
218230
219- [Parameter ()]
231+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
220232 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
221- [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.Info (PossibleTypes= ([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001. IResourceTags ]))]
233+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.Info (PossibleTypes= ([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.IResourceTags ]))]
222234 [System.Collections.Hashtable ]
223235 # Resource tags
224236 ${Tag} ,
225237
238+ [Parameter (ParameterSetName = ' CreateViaJsonFilePath' , Mandatory )]
239+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
240+ [System.String ]
241+ # Path of Json file supplied to the Create operation
242+ ${JsonFilePath} ,
243+
244+ [Parameter (ParameterSetName = ' CreateViaJsonString' , Mandatory )]
245+ [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Body' )]
246+ [System.String ]
247+ # Json string supplied to the Create operation
248+ ${JsonString} ,
249+
226250 [Parameter ()]
227251 [Alias (' AzureRMContext' , ' AzureCredential' )]
228252 [ValidateNotNull ()]
229253 [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category (' Azure' )]
230254 [System.Management.Automation.PSObject ]
231- # The credentials, account, tenant, and subscription used for communication with Azure.
255+ # The DefaultProfile parameter is not functional.
256+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
232257 ${DefaultProfile} ,
233258
234259 [Parameter ()]
0 commit comments