Set-AzureRmVM
Marks a virtual machine as generalized.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
Set-AzureRmVM
[-ResourceGroupName] <String>
[-Name] <String>
[-Generalized]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Set-AzureRmVM
[-ResourceGroupName] <String>
[-Name] <String>
[-Redeploy]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Set-AzureRmVM
[-Id] <String>
[-Name] <String>
[-Generalized]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Set-AzureRmVM
[-Id] <String>
[-Name] <String>
[-Redeploy]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Set-AzureRmVM cmdlet marks a virtual machine as generalized. Before you run this cmdlet, log on to the virtual machine and use Sysprep to prepare the hard disk.
Examples
Example 1: Mark a virtual machine as generalized
PS C:\> Set-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Generalized
This command marks the virtual machine named VirtualMachine07 as generalized.
Parameters
-AsJob
Run cmdlet in the background and return a Job to track progress.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
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 |
-Generalized
Indicates that this cmdlet marks a virtual machine as generalized.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
Specifies the Resource ID of the virtual machine.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of the virtual machine on which this cmdlet operates.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Redeploy
Indicates that this cmdlet manually redeploys the virtual machine to a different Azure host to fix any problems. If you redeploy a virtual machine, it restarts, which results in the loss of ephemeral drive data.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
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 |