Removing a Temporary Template from System Center Virtual Machine Manager 2012 R2 using PowerShell.

While going through a house cleaning task in System Center Virtual Machine Manager 2012 R2, I found that I couldn’t remove a vhdx file that was part of a template.This is because the vhdx still had a dependency called “Temporary Template11ef26ce-a6bd-421b-86f2-9cacd0e0f484”:

Template00

Since I couldn’t remove the temporary template from the graphical user interface, I resorted to powershell to accomplish this with the Get-SCVMTemplate cmdlet. The screen below shows a snapshot of the result:

Get-SCVMTemplate

The result from the above query is piped to the Remove-SCVMTemplate to remove the erring template:

Remove-Template

PS C:\scripts> Get-SCVMTemplate -Name "Temporary Template11ef26ce-a6bd-421b-86f2-9cacd0e0f484" | Remove-SCVMTemplate

After running the script successfully, the dependency is seen to be removed.

Advertisement
This entry was posted in Hyper-v 2012 R2, SCVMM2012R2, System Center 2012 R2, VHDX, Virtual Machine Manager 2012 R2, Virtual Machines, Windows Server 2012 R2 and tagged , , , , , . Bookmark the permalink.

4 Responses to Removing a Temporary Template from System Center Virtual Machine Manager 2012 R2 using PowerShell.

  1. otelifantastic says:

    Well done. #Genius

  2. rishipandit says:

    Great post, Thanks a lot.

  3. rishipandit says:

    Great post, Thanks a lot.

  4. mke says:

    Deleting the template will affect the vms created from it?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s