How can we disable vTPM(Trusted platform module) for Windows Virtual machine using powershell script

Ishan Saxena 60 Reputation points
2025-01-17T12:53:14.99+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.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,299 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,599 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,780 questions
0 comments No comments
{count} votes

Accepted answer
  1. Markapuram Sudheer Reddy 425 Reputation points Microsoft Vendor
    2025-01-17T17:10:39.3966667+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.


0 additional answers

Sort by: Most helpful

Your answer

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