Set-AzVMAccessExtension
Adds the VMAccess extension to a virtual machine.
Syntax
Set-AzVMAccessExtension
[-Credential <PSCredential>]
[-ResourceGroupName] <String>
[-VMName] <String>
[-Name <String>]
[-TypeHandlerVersion <String>]
[-Location <String>]
[-DisableAutoUpgradeMinorVersion]
[-ForceRerun <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-AzVMAccessExtension cmdlet adds the Virtual Machine Access (VMAccess) Virtual Machine VMAccess Extension to a virtual machine. VMAccess Extension can be used to set a temporary password and this should be immediately changed it after logging into the machine.
Examples
Example 1: Add a VMAccess extension
PS C:\> Set-AzVMAccessExtension -ResourceGroupName "ResrouceGroup11" -Location "Central US" -VMName "VirtualMachine07" -Name "ContosoTest" -TypeHandlerVersion "2.0" -UserName "PFuller" -Password "Password"
This command adds a VMAccess extension for the virtual machine named VirtualMachine07 in ResrouceGroup11. The command specifies the name and type handler version for VMAccess.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-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
.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableAutoUpgradeMinorVersion
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-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.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Location
Specifies the location of the virtual machine.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of the extension that this cmdlet adds.
Type: | String |
Aliases: | ExtensionName |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
Specifies the name of the resource group of the virtual machine.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TypeHandlerVersion
Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter.
Type: | String |
Aliases: | HandlerVersion, Version |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMName
Specifies the name of a virtual machine. This cmdlet adds VMAccess for the virtual machine that this parameter specifies.
Type: | String |
Aliases: | ResourceName |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
None
This cmdlet does not accept any input.