Set-AzVMSecurityProfile
Sets the SecurityType enum for Virtual Machines.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Set-AzVMSecurityProfile
[-VM] <PSVirtualMachine>
[-SecurityType <SecurityTypes>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Set-AzVmSecurityProfile cmdlet sets the Security Type of the VM
Examples
Example 1
$VM = Get-AzVM -ResourceGroupName "ResourceGroup11" -VMName "ContosoVM07"
$VM = Set-AzVmSecurityProfile -VM $VM -SecurityType "TrustedLaunch"
The first command gets the virtual machine named ContosoVM07 by using Get-AzVm. The command stores it in the $VM variable. The second command sets the SecurityType enum to "TrustedLaunch"
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-SecurityType
Enum that represents the security type (ex: Trusted Launch)
| Type: | SecurityTypes |
| Accepted values: | TrustedLaunch |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
-VM
The virtual machine profile.
| Type: | PSVirtualMachine |
| Aliases: | VMProfile |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |