하이퍼-V Virtual Machine Restart 파워셸 Script. In our company, we use VDI infrastructure with virtual machine pools working at 윈도우 서버 하이퍼-V 2012 R2. Because we have many GPO, that fast changed and applied to the workstation we need to reboot machines occasionally. But not used machines went to save state if not using about 10 minutes. So we decide to write this script to “reboot machines” at night and create a task in the 창문들 scheduler. As we have 4 pools we create 4 scripts for pools VMs and 4 tasks, that run at night with intervals of 2 hours.
How to:
Because we save not used machines we can’t reboot them, so we do run – shutdown – run – save. Maybe it’s somewhere wrong, but it’s work. This is the 윈도우 파워셸 script: