Mar 312017
Problem:
In my environment I have about 300 provisioned desktops, and when I update the vDisk sometimes it can take a while (days) before all of the VMs get the latest version. Especially, in the case of a roll back I need a good way to get all of the VMs which are on the wrong version (and are waiting for a session) to boot to the correct version.
Solution:
POWERSHELL!!
Requirements:
I think powershell version 3, but since I did it with v4 I’ll say 4+
PVS powershell module installed (learn more here)
Powershell remoting enabled on your delivery controller (also need to supply the name in the script)
What the script does:
- Gets a list of the Collections in your PVS environment, and outputs it to out-gridview so you can select the collection you want to focus on
- If you hit cancel the script ends
- After your select the collection and hit ok it will get all of the devices in that collection which are powered on, and cannot access a maintenance/private disk image
- For each of the devices in that list it checks to see if they have the latest vDisk version, or if they have the correct OverRide version.
- If they do then it tells you the device is on the correct version, and moves on to the next device
- If they do not then it will pass the device name to the check function, and after moves on to the next device
- invokes powershell on the delivery controller to see if the VM is in use (powershell remoting required)
- If it is, it tells you it is in use and does nothing
- If it is not it will reboot the vm, and tell you
- invokes powershell on the delivery controller to see if the VM is in use (powershell remoting required)
Here is the script! Remember to test it before using it in a production environment.