Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Set-AzVMADDomainExtension
- Module:
- Az.Compute Module
Adds an AD domain extension to a virtual machine.
Syntax
Default (Default)
Set-AzVMADDomainExtension
-DomainName <String>
[-OUPath <String>]
[-JoinOption <UInt32>]
[-Credential <PSCredential>]
[-Restart]
[-ResourceGroupName] <String>
[-VMName] <String>
-Name <String>
[-TypeHandlerVersion <String>]
[-Location <String>]
[-DisableAutoUpgradeMinorVersion]
[-ForceRerun <String>]
[-NoWait]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-AzVMADDomainExtension cmdlet adds a Microsoft Entra ID virtual machine extension to a virtual machine. This extension lets your virtual machine join a domain.
Examples
Example 1
# Create a Resource Group and Virtual Machine before this.
$extensionName = "extensionName"
$virtualMachineName = "vmName"
$resourceGroupName = "resourceGroupName"
$domainName = "domain.com"
Set-AzVMADDomainExtension -ResourceGroupName $resourceGroupName -VMName $virtualMachineName -Name $extensionName -DomainName $domainName
RequestId IsSuccessStatusCode StatusCode ReasonPhrase
--------- ------------------- ---------- ------------
True OK OK
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
-Credential
Specifies the user name and password for the virtual machine as a PSCredential object.
To obtain a credential, use the Get-Credential cmdlet.
For more information, type Get-Help Get-Credential.
Parameter properties
| Type: | PSCredential |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-DisableAutoUpgradeMinorVersion
Indicates that this cmdlet disables auto-upgrade of the minor version of the extension.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DomainName
Specifies the name of the domain.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ForceRerun
Indicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-JoinOption
Specifies the join option. For join options see JoinOptions
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Location
Specifies the location of the virtual machine.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Name
Specifies the name of the domain extension to add.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | ExtensionName |
Parameter sets
-NoWait
Starts the operation and returns immediately, before the operation is completed. In order to determine if the operation has successfully been completed, use some other mechanism.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-OUPath
Specifies an organizational unit (OU) for the domain account. Enter the full distinguished name of the OU in quotation marks. The default value is the default OU for machine objects in the domain.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceGroupName
Specifies the name of the resource group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Restart
Indicates that this cmdlet restarts the virtual machine. A restart is often required to make the change effective.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-TypeHandlerVersion
Specifies the version of the domain extension.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | HandlerVersion, Version |
Parameter sets
-VMName
Specifies the name of the virtual machine.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | ResourceName |
Parameter sets
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
String
Nullable<T>
PSCredential
SwitchParameter
Outputs
PSAzureOperationResponse
Related Links
Azure PowerShell
Feedback
Was this page helpful?
