Recently, a customer has been able to update the Windows 7 Master
Without moving to studio, you can update it every month,
So I wrote a PowerShell for this requirement and set it up in Windows 2012.
First, the basic environment.
Hypervisor:xenserver 6.5
Os:windows R2
Virtual Desktop version: Xendesktop7.6.3
$Today = get-date -uformat %y%m%d_%h%m%s # #設定Snapshot日期
New-hypvmsnapshot -adminaddress "ddc.citrix.com:80" -literalpath "Xdhyp:\hostingunits\dd\windows 7 TEST.VM" -snapshotname "Citrix_$Today"# #執行Snapshot的VM
$ProvSchemeName = "TESTSCRIPTS" # #需要針對你的Machin the name definition on catalogs to do update
$Snapshot = "Citrix_ $Today "
Start-sleep - S In the #如果不停止30sec, the environment on my side will take a couple of paths to the next number of variables.
$VM = Get-childitem -adminaddress "ddc.citrix.com:80" "Xdhyp:\hostingunits\dd\" | Where-object {$_.ObjectType -eq ' VMS ' -and $_.Pschildname -like ' Windows 7 test.vm '} # #抓取Hypervisor中要做母版更新的VM路徑
$VMSnapshot = Get-childitem -adminaddress "ddc.citrix.com:80" $VM.FullPath -recurse -include *.snapshot # #抓取更新VM機器之中的Snapshot路徑1
$TargetSnapshot = $VMSnapshot | Where-object {$_.FullName -eq "$snapshot. Snapshot "} # #抓取更新VM機器之中的Snapshot路徑2
Set-provschememetadata -adminaddress "ddc.citrix.com:80" -name "Imagemanagementprep_doimagepreparation" -provisioningschemename "TESTSCRIPTS" -value "True" # #準備更新的process
Publish-provmastervmimage -provisioningschemename $ProvSchemeName -MASTERIMAGEVM $TargetSnapshot.FullPath -adminaddress "ddc.citrix.com:80" -runasynchronously # #執行更新開始
start-brokernaturalrebootcycle -adminaddress "ddc.citrix.com:80" -inputobject @("TESTSCRIPTS") # #更新後直接重開
Reference Web site:
http://stealthpuppy.com/xendesktop-update-mcs-machine-catalog-powershell/
This article is from the "Michael's Road to Citrix" blog, so be sure to keep this source http://10802310.blog.51cto.com/10792310/1903739
How to use XenDesktop PowerShell to do update machines--limit pool