Q
Get started Bring yourself up to speed with our introductory content.

Use PowerShell to export, back up SCVMM service templates

It's getting difficult to keep track of all the service templates in SCVMM. Is there a simple command that enables us to query and export them easily?

SCVMM templates and SCVMM service templates can help deploy production VMs and grouped VMs quickly. They can also...

redeploy VMs, if there are issues with existing VMs.

If you've configured hundreds of SCVMM templates, it's important to perform regular backups to eliminate the need to reconfigure SCVMM templates. There are three ways to back up SCVMM templates. You can perform a regular backup of the SCVMM database, which takes a backup of SCVMM templates in addition to backing up other SCVMM configurations. However, if you only need to export SCVMM templates, you can either use PowerShell or the SCVMM console.

From the SCVMM console, right-click on a template and then click Export. PowerShell reduces the time it takes to perform export operations for multiple templates. You can use the Export-SCTemplate PowerShell cmdlet to export SCVMM templates.

If you need to query SCVMM service templates using PowerShell, use the Get-SCVMTemplate PowerShell cmdlet, as shown in the command below:

Get-SCVMTemplate –VMServer "VMM1Server.TechTarget.Com"

The above command lists all the SCVMM service templates you've created in SCVMM. To export SCVMM service templates, run Export-SCTemplate, as shown in the command below:

Get-SCServiceTemplate | Export-SCTemplate –Path "E:\AllTemplates\"

This command exports all templates to E:\AllTemplates, including every detail about the service templates. A small PowerShell script can help you export all service templates with their names, as shown in the script below.

$AllTemplatesNow = Get-SCServiceTemplate –Name *

ForEach ($Template in $AllTemplatesNow)

{ Export-SCTemplate –ServiceTemplate $Template –Path “E:\ExportedTemplates\$Template }

When you execute the above script, each SCVMM service template from SCVMM will be exported by its name under C:\ExportedTemplates location.

Next Steps

Get started with these PowerShell cmdlets

Check the health status of Hyper-V with PowerShell

Deploy Hyper-V clusters with SCVMM

This was last published in April 2017

Dig Deeper on Microsoft Hyper-V management

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What are some other ways to manage SCVMM templates and SCVMM service templates?
Cancel

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close