博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Update-ServiceTemplate
阅读量:7087 次
发布时间:2019-06-28

本文共 3382 字,大约阅读时间需要 11 分钟。

1: Update a service by using conventional servicing.
PS C:\> $Service = Get-SCService -Name "Service01"PS C:\> $SvcTemplate = Get-SCServiceTemplate -Name "ServiceTemplate01"PS C:\> $PendingTemplate = New-SCServiceTemplate -ServiceTemplate $SvcTemplate -Name "ServiceTemplate01" -Release "RTM"PS C:\> Set-SCService -Service $Service -PendingServiceTemplate $PendingTemplatePS C:\> Update-SCService -Service $Service
The first command gets the service object named Service01, which is a deployed service, and stores the object in the $Service variable.The second command gets the service template object named ServiceTemplate01 and stores the object in the $SvcTemplate variable.The third command creates an RTM release of the service template stored in $SvcTemplate.The fifth command sets the pending template on the service instance to the updated service template stored in $PendingTemplate.The last command updates Service01.
2: Update a service by using image-based servicing.
PS C:\> $Service = Get-SCService -Name "Service02"PS C:\> $SvcTemplate = Get-SCServiceTemplate -Name "ServiceTemplate02"PS C:\> $PendingTemplate = New-SCServiceTemplate -ServiceTemplate $SvcTemplate -Name "ServiceTemplate02" -Release "RTM"PS C:\> $WebTier = Get-SCComputerTierTemplate -ServiceTemplate $PendingTemplate -Name "Web Tier"PS C:\> $WebTemplate = Get-SCVMTemplate -ComputerTierTemplate $WebTier | Set-SCVMTemplate -MemoryMB 2048PS C:\> $BaseDisk2 = Get-SCVirtualHardDisk -Name "Win2k8R2BaseDisk_Patched.vhd"PS C:\> $VHD = Get-SCVirtualDiskDrive -VMTemplate $WebTemplate PS C:\> Remove-SCVirtualDiskDrive -VirtualDiskDrive $VHDPS C:\> New-SCVirtualDiskDrive -VirtualHardDisk $BaseDisk2 -VMTemplate $WebTemplate -BootVolume -SystemVolume -Bus 0 -LUN 0 -ide -VolumeType BootAndSystemPS C:\> Set-SCService -Service $Service -PendingServiceTemplate $PendingTemplate PS C:\> Update-SCService -Service $Service
The first command gets the service object named Service02 and stores the object in the $Service variable.The second command gets the service template object named ServiceTemplate02 and stores the object in the $SvcTemplate variable.The third command creates a new release of the service template stored in $SvcTemplate, names it ServiceTemplate02, gives it a release of RTM and stores the template in $PendingTemplate.The fourth command gets the computer tier object named Web Tier for the service template stored in $PendingTemplate and stores the object in the $WebTier variable.The fifth command adds memory to the virtual machine template for the computer tier stored in $WebTier.The sixth command gets the virtual hard disk object named Win2k8R2BaseDisk_Patched.vhd and stores the object in the $BaseDisk2 variable. This virtual hard disk contains an updated version of the operating system.The seventh command gets the virtual disk drive object on the virtual machine template stored in $WebTemplate and stores the object in the $VHD variable.The eighth command removes the virtual disk drive object stored in $VHD.The ninth command adds the virtual hard disk object stored in $BaseDisk2 to the virtual machine template object stored in $WebTemplate.The tenth command sets the pending template on the service instance to the updated service template stored in $PendingTemplate.The last command updates Service02. From:http://systemscenter.ru/vmm2012cmdlets.en/Update-SCService.html

转载地址:http://koyql.baihongyu.com/

你可能感兴趣的文章
nginx正则表达式(上篇)
查看>>
Spark入门(六)--Spark的combineByKey、sortBykey
查看>>
一款Android图文识别与扫描软件
查看>>
封装的前端常用工具函数
查看>>
好程序员web前端教程:对象
查看>>
算法排序篇——选择排序与插入排序
查看>>
浮动 二 文字围绕现象 (上)
查看>>
【每日推理2019/05/25】
查看>>
React生命周期
查看>>
Java基础系列四
查看>>
JVM实用参数(四)内存调优
查看>>
HBase2.0重新定义小对象实时存取
查看>>
npm包:moment的使用
查看>>
命令别名:保护和服务
查看>>
Android精通教程-第一节Android入门简介
查看>>
阿里云前端周刊 - 第 35 期
查看>>
【云周刊】第150期:阿里云发布首款全球智能互联的网络产品——云骨干网
查看>>
Olympus Labs 进展简报(0415)
查看>>
Java并发编程(一)线程的各种创建方式
查看>>
在赛事平台发布赛事活动需要注意什么?
查看>>