---
title: "Comment by Casey Kourofsky on \"Importing Hyper-V VMs with Enabled TPM\" | Hashnode"
description: "Do you know how you could &#39;re-create&#39; those certificates from scratch? I (very stupidly) exported mine without the keys - then proceeded to delete them."
url: "https://hashnode.com/posts/importing-hyper-v-vms-with-enabled-tpm/62e8cb703f084d032011c445/comment/637515afe1d53a5fd290e856"
---

[Discussion](https://hashnode.com/posts/importing-hyper-v-vms-with-enabled-tpm/62e8cb703f084d032011c445)

Comment [Importing Hyper-V VMs with Enabled TPM](https://hashnode.com/posts/importing-hyper-v-vms-with-enabled-tpm/62e8cb703f084d032011c445)

[Casey Kourofsky](https://hashnode.com/@CKour)

[Nov 16, 2022](https://hashnode.com/posts/importing-hyper-v-vms-with-enabled-tpm/62e8cb703f084d032011c445/comment/637515afe1d53a5fd290e856)

Do you know how you could 're-create' those certificates from scratch? I (very stupidly) exported mine without the keys - then proceeded to delete them.

[Ash Roberts](https://hashnode.com/@SwitchITUp)

[Nov 16, 2022](https://hashnode.com/posts/importing-hyper-v-vms-with-enabled-tpm/62e8cb703f084d032011c445/comment/637515afe1d53a5fd290e856#reply-637534fe2cab3a64dcb6c335)

Sorry to be the bearer of bad news but if you lose the certificates, you're never getting back into the machine unfortunately. Unless you have a system state backup of the host to roll back to.

more info here: [altaro.com/hyper-v/hyper-v-2016-shielded-virtual-…](https://www.altaro.com/hyper-v/hyper-v-2016-shielded-virtual-machines-stand-alone-hosts/)

[Casey Kourofsky](https://hashnode.com/@CKour)

[Nov 17, 2022](https://hashnode.com/posts/importing-hyper-v-vms-with-enabled-tpm/62e8cb703f084d032011c445/comment/637515afe1d53a5fd290e856#reply-63769848abae2b7516a86942)

[Ash Roberts](https://hashnode.com/@SwitchITUp) So - thankfully, I had taken steps to make sure that I COULD get back into my VM. Prior to removing the certificates, I had unencrypted the drives, turned off TPM and tested rebooting successfully.

What my REAL problem turned out to be, is that I was trying to do this process on a host running server CORE - which will not allow you to remotely export the certificates with a private key. I had to find PowerShell commands to allow me to do this whole export/import process from the hosts.

I also found that I could re-create my certificates from PowerShell as well. In case anyone else finds this useful, what I did is below.

I found the existing guardian: Get-HgsGuardian

I then removed it: Remove-HgsGuardian -Name "UntrustedGuardian"

And finally, I recreated the Guardian with the certificates: New-HgsGuardian -Name "UntrustedGuardian" -Generatecertificates

[Ash Roberts](https://hashnode.com/@SwitchITUp)

[Nov 20, 2022](https://hashnode.com/posts/importing-hyper-v-vms-with-enabled-tpm/62e8cb703f084d032011c445/comment/637515afe1d53a5fd290e856#reply-637a5ca6b1e7ce958945582e)

[Casey Kourofsky](https://hashnode.com/@CKour) oh nice, thanks for the insight :)
