Share via

how to disable vTPM using powershell script

ishan saxena 125 Reputation points
2025-01-16T16:13:47.45+00:00

We are trying to move our windows 11 VM from one cluster to another which requires vTPM (Trusted platform module) to be disabled. After re-enabling vTPM after performing the migration we get tmp error - C0090016, TPM has malfunctioned Microsoft 365 Sign-in Error

Is there a way to disable vTPM using powershell for windows 11 rather than doing on VM security setting from azure portal.

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Sudheer Reddy 2,075 Reputation points Moderator
    2025-01-17T15:12:47.6166667+00:00

    Hi ishan saxena ,

    Thank you for reaching out us on Microsoft Q&A forum.

    You can follow below PowerShell command to disable vTPM on a windows 11 VM when hosted in a Azure environment. You need to modify UEFI properties of a Virtual Machine.

    $VM = Get-AzVM -ResourceGroupName "<your resource group name>" -VMName "<your VM name>" Set-AzVMUefi -VM $VM -EnableVtpm $false -EnableSecureBoot $false
    
    

    You can use the above PowerShell command and modify the input values based on your requirement before executing the command.

    You can follow below documentation for more information ;

    https://stackoverflow.com/questions/76627839/is-it-possible-to-make-uefi-settings-on-off-using-powershell-command-in-a-virtua

    https://learn.microsoft.com/en-us/powershell/module/az.compute/set-azvmuefi?view=azps-13.1.0

    If the information is helpful, please consider by clicking the "Accept Answer" & "Upvote".

    If you have any further queries, please let us know we are glad to help you.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.