{"id":313,"date":"2019-01-13T22:27:47","date_gmt":"2019-01-13T14:27:47","guid":{"rendered":"https:\/\/kylemcdonald.com.au\/?p=313"},"modified":"2019-05-26T16:54:25","modified_gmt":"2019-05-26T08:54:25","slug":"taking-screenshots-of-vm-consoles","status":"publish","type":"post","link":"https:\/\/kylemcdonald.com.au\/2019\/01\/13\/taking-screenshots-of-vm-consoles\/","title":{"rendered":"Taking screenshots of VM consoles"},"content":{"rendered":"\n
A client of mine asked for assistance in identifying virtual appliances in their environment, in order to tag them for future work they had planned.<\/p>\n\n\n\n
As they had many thousands of VM’s, it would have been an arduous task to review them one-by-one. As the vast majority of virtual appliances are not windows based, I was able to narrow the field down to a few hundred VM’s that needed a manual review.<\/p>\n\n\n\n
The question then became; how to distinguish a virtual appliance from a normal *nix-based VM? The easiest way would be to look at the console of each VM!<\/p>\n\n\n\n
Rather than re-invent the wheel, I looked around for any PowerCLI scripts that would take a screenshot of a VM console and found one written by While Patrick’s script did the job for a few VM’s, I needed to be able to hit hundreds of VM’s across a number of different clusters as well as wake the consoles up so the screenshot wasn’t just a black screen.<\/p>\n\n\n\n After tweaking the code, and a little help from William Lam’s blog<\/a>, I was able to come up with my own version of the script that had the functionality I required.<\/p>\n\n\n\n You can view my script on GitLab here: https:\/\/gitlab.com\/KarmicIT\/public\/blob\/master\/Get-ScreenshotFromVM.ps1<\/a><\/p>\n\n\n\n
Patrick Terlisten<\/a>.<\/p>\n\n\n\n