PowerCLI Reference



This cmdlet unlocks the specified virtual machine.


Unlock-VM [-VM] <VirtualMachine[]> [-Confirm] [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [<CommonParameters>]

Related Commands


Detailed Description

This cmdlet unlocks the specified virtual machine. The virtual machine should be encrypted, otherwise, this cmdlet would fail. If the virtual machine is in CryptoLocked state, this cmdlet will make the virtual machine become connected state.


NameTypeDescriptionRequired?Pipeline InputDefault Value
VMVirtualMachine[]Specifies the virtual machine that you want to unlock.trueTrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falseFalse
RunAsyncSwitchParameterIndicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter, run "help About_RunAsync" in the VMware PowerCLI console.falseFalse
ServerVIServer[]Specifies the connected viserver on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default viservers. For more information about default viservers, see the description of the Connect-VIServer cmdlet.falseFalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falseFalse

Return Type



This cmdlet only works with a encrypted virtual machine. If the virtual machine is encrypted and in connected state, it will make vCenter Server system sync keys to ESX; If the virtual machine is encrypted and locked, it will bring the virtual machine back to connected state. This cmdlet only works with vCenter Server and ESX of versions 6.7 or later.


-------------------------- Example 1 --------------------------

Get-VM 'MyVM' | Unlock-VM

Unlocks the virtual machine named 'MyVM'.

Copyright © VMware, Inc. All rights reserved.