다음을 통해 공유


(스크립트)이전 백업에서 누락 된 서비스 템플릿 가져오기

 

적용 대상: System Center 2012 R2 Virtual Machine Manager, System Center 2012 - Virtual Machine Manager

이 항목의 스크립트에서 삭제 된 서비스 템플릿을 복원 하는 System Center 2012 – Virtual Machine Manager(VMM) 라이브러리입니다. 샘플 스크립트를 사용 하 여 템플릿 파일을 백업한 것으로 가정 야간 백업 서비스 템플릿 (스크립트)합니다.

부인

다음 스크립트 끌어간 템플릿 이름에 대 한 사용자를 다음 백업 템플릿 패키지에서 누락 된 서식 파일을 가져옵니다. 그런 다음 스크립트를 라이브러리에 서식 파일을 가져옵니다. 서식 파일을 백업 하는 경우 경로 변경한 경우 해당 백업 경로 일치 하도록 다음 스크립트에 포함 된 경로 업데이트 합니다.

# Description:   This script restores a service template that has been inadvertently
#                deleted from the library from a previously exported package.

# Get the missing template form yesterday's backed-up service template packages.
$Template = Read-Host "Enter the name of the missing service template"
$Release = Read-Host "Enter the release of the missing service template"
$ServiceTemplate = "$Template.$ Release.xml"
$Yesterday = (Get-Date).AddDays(-1)
$Date = Get-Date -Date $Yesterday -Uformat "%Y_%m_%d"
$Package = Get-SCTemplatePackage -Path D:\TemplateExports\$Date\$ServiceTemplate

# Import the service template into the library.
Import-SCTemplate -TemplatePackage $Package -SettingsIncludePrivate

참고 항목

SCTemplate 가져오기