Skip to content

[Az.AddomainService] ADDomainServices update generation tool version: autorest.powershell … #27451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 11, 2025
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the ""License"");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an ""AS IS"" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
// is regenerated.

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - AdDomainServices")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.2.3")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.2.3")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]

20 changes: 8 additions & 12 deletions src/ADDomainServices/ADDomainServices.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ title: ADDomainServices
service-name: ADDomainServices
subject-prefix: ADDomainService

# If there are post APIs for some kinds of actions in the RP, you may need to
# uncomment following line to support viaIdentity for these post APIs
# identity-correction-for-post: true
resourcegroup-append: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
- from: swagger-document
where: $.definitions..pfxCertificatePassword
Expand All @@ -73,7 +64,10 @@ directive:
"description": "HTTP 200 (OK) should be returned if the object exists and was deleted successfully."
}
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the migration guide to remove variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$

remove: true
- where:
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
remove: true
# Remove the set-* cmdlet
- where:
Expand Down Expand Up @@ -135,8 +129,10 @@ directive:
set:
parameter-name: ResourceForest
- model-cmdlet:
- ForestTrust
- ReplicaSet
- model-name: ForestTrust
cmdlet-name: New-AzADDomainServiceForestTrustObject
- model-name: ReplicaSet
cmdlet-name: New-AzADDomainServiceReplicaSetObject
- where:
model-name: DomainService
set:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,25 @@

<#
.Synopsis
The Create Domain Service operation creates a new domain service with the specified parameters.
The create Domain Service operation create a new domain service with the specified parameters.
If the specific service already exists, then any patchable properties will be updated and any immutable properties will remain unchanged.
.Description
The Create Domain Service operation creates a new domain service with the specified parameters.
The create Domain Service operation create a new domain service with the specified parameters.
If the specific service already exists, then any patchable properties will be updated and any immutable properties will remain unchanged.
.Example
$replicaSet = New-AzADDomainServiceReplicaSetObject -Location westus -SubnetId /subscriptions/********-****-****-****-**********/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default
New-AzADDomainService -name youriADdomain -ResourceGroupName youriAddomain -DomainName youriAddomain.com -ReplicaSet $replicaSet
New-AzADDomainService -Name youriADdomain -ResourceGroupName youriAddomain -DomainName youriAddomain.com -ReplicaSet $replicaSet
.Example
# 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)

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.IDomainService
Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.IDomainService
.Notes
COMPLEX PARAMETER PROPERTIES

Expand All @@ -46,189 +54,206 @@ REPLICASET <IReplicaSet[]>: List of ReplicaSets
https://learn.microsoft.com/powershell/module/az.addomainservices/new-azaddomainservice
#>
function New-AzADDomainService {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.IDomainService])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.IDomainService])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
[Alias('DomainServiceName')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Path')]
[System.String]
# The name of the domain service.
${Name},

[Parameter(Mandatory)]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Path')]
[System.String]
# The name of the resource group within the user's subscription.
# The name is case insensitive.
${ResourceGroupName},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaJsonFilePath')]
[Parameter(ParameterSetName='CreateViaJsonString')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
# Gets subscription credentials which uniquely identify the Microsoft Azure subscription.
# The subscription ID forms part of the URI for every service call.
${SubscriptionId},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[ArgumentCompleter({'FullySynced', 'ResourceTrusting'})]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[System.String]
# Domain Configuration Type
${DomainConfigurationType},

[Parameter(Mandatory)]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[System.String]
# The name of the Azure domain that the user would like to deploy Domain Services to.
${DomainName},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NtlmV1])]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NtlmV1]
[System.String]
# A flag to determine whether or not NtlmV1 is enabled or disabled.
${DomainSecuritySettingNtlmV1},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncKerberosPasswords])]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncKerberosPasswords]
[System.String]
# A flag to determine whether or not SyncKerberosPasswords is enabled or disabled.
${DomainSecuritySettingSyncKerberosPassword},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncNtlmPasswords])]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncNtlmPasswords]
[System.String]
# A flag to determine whether or not SyncNtlmPasswords is enabled or disabled.
${DomainSecuritySettingSyncNtlmPassword},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncOnPremPasswords])]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.SyncOnPremPasswords]
[System.String]
# A flag to determine whether or not SyncOnPremPasswords is enabled or disabled.
${DomainSecuritySettingSyncOnPremPassword},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.TlsV1])]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.TlsV1]
[System.String]
# A flag to determine whether or not TlsV1 is enabled or disabled.
${DomainSecuritySettingTlsV1},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[System.String]
# Resource etag
${Etag},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.FilteredSync])]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.FilteredSync]
[System.String]
# Enabled or Disabled flag to turn on Group-based filtered sync
${FilteredSync},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.IForestTrust[]]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.IForestTrust[]]
# List of settings for Resource Forest
# To construct, see NOTES section for FORESTTRUST properties and create a hash table.
${ForestTrust},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.ExternalAccess])]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.ExternalAccess]
[System.String]
# A flag to determine whether or not Secure LDAP access over the internet is enabled or disabled.
${LdapSettingExternalAccess},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.Ldaps])]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.Ldaps]
[System.String]
# A flag to determine whether or not Secure LDAP is enabled or disabled.
${LdapSettingLdaps},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[System.String]
# Input File for LdapSettingPfxCertificate (The certificate required to configure Secure LDAP.
# The parameter passed here should be a base64encoded representation of the certificate pfx file.)
${LdapSettingPfxCertificateInputFile},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[System.Security.SecureString]
# The password to decrypt the provided Secure LDAP certificate pfx file.
${LdapSettingPfxCertificatePassword},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.DefaultInfo(Name='Location Default', Description='Gets the Location from the first element in ReplicaSets.', Script='$ReplicaSet[0].Location')]
[System.String]
# Resource location
${Location},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[System.String[]]
# The list of additional recipients
${NotificationSettingAdditionalRecipient},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NotifyDcAdmins])]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NotifyDcAdmins]
[System.String]
# Should domain controller admins be notified
${NotificationSettingNotifyDcAdmin},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NotifyGlobalAdmins])]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Support.NotifyGlobalAdmins]
[System.String]
# Should global admins be notified
${NotificationSettingNotifyGlobalAdmin},

[Parameter(Mandatory)]
[Parameter(ParameterSetName='CreateExpanded')]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.IReplicaSet[]]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.IReplicaSet[]]
# List of ReplicaSets
# To construct, see NOTES section for REPLICASET properties and create a hash table.
${ReplicaSet},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[System.String]
# Resource Forest
${ResourceForest},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[ArgumentCompleter({'Standard', 'Enterprise', 'Premium'})]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[System.String]
# Sku Type
${Sku},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.IResourceTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.IResourceTags]))]
[System.Collections.Hashtable]
# Resource tags
${Tag},

[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[System.String]
# Path of Json file supplied to the Create operation
${JsonFilePath},

[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Body')]
[System.String]
# Json string supplied to the Create operation
${JsonString},

[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Azure')]
[System.Management.Automation.PSObject]
# The credentials, account, tenant, and subscription used for communication with Azure.
# The DefaultProfile parameter is not functional.
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
${DefaultProfile},

[Parameter()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Create an in-memory object for ForestTrust.
Create an in-memory object for ForestTrust.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.ForestTrust
Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.ForestTrust
.Link
https://learn.microsoft.com/powershell/module/Az.ADDomainServices/new-AzADDomainServiceForestTrustObject
https://learn.microsoft.com/powershell/module/Az.ADDomainServices/new-azaddomainserviceforesttrustobject
#>
function New-AzADDomainServiceForestTrustObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.ForestTrust')]
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.ForestTrust')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -48,7 +49,7 @@ function New-AzADDomainServiceForestTrustObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.ForestTrust]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.ForestTrust]::New()

if ($PSBoundParameters.ContainsKey('FriendlyName')) {
$Object.FriendlyName = $FriendlyName
Expand Down
Loading