Cleaning your vCloud Director Thumbnails (current.png)

June 15, 2013

Table of Contents

Thumbnail images are used by vCloud Director to give you a preview of the screen without opening up to the remote console, the dark side is when you migrate/svMotion a machine managed by vCloud Director, it leaves a folder along with the thumbnail, this thumbnails are created and stored by vCloud Director as current.png on the datastore in the VM’s if you are in your datastores and VMsa look or sometimes get sloopy. This PowerCLI script helps solve this, it goes through a particular datastore, and deletes all abandoned current.png files and the VM folder, this process keeps your datastores neat.

$datastore = “MyDatastore”

$viserver = “MyVIServer”

# add PowerCLI snapin

Add-PSSnapin vmware.vimautomation.core -ErrorAction:SilentlyContinue

# Connect to VI Server

Connect-VIServer $viserver

# Get the datastore we want to clean up

$dsObject = Get-Datastore $datastore

# Create a new PSDrive to that datastore

New-PSDrive -Location $dsObject -name ds -PSProvider VimDatastore -root ”

# Set location to that drive

Set-Location ds:

# From here we are going to parse through

# folders first looking for vmx files,

# if there are no vmx files,

# test for current.png and then remove the thumbnail and folder.

$dsfolders = Get-ChildItem

foreach ($dsfolder in $dsfolders)


    if (!(test-path “$dsfolder*.vmx”))


        if (test-path “$dsfoldercurrent.png”)


            remove-item “$dsfoldercurrent.png”

            if ((get-childitem .$dsfolder* | measure-object).count -lt 1)


                remove-item $dsfolder






Share on
More posts

Dedicated Servers Quick Guide

What is a Dedicated Servers? Why bother using a dedicated server over a VPS or Shared Hosting?A dedicated server is a server 100% dedicated to your website/project or business needs.

vMA 5.1 Patch 1 Released

Expendable news item here too good not to be posted.  For those who may have missed it, VMware has released an update to the vSphere Management Assistant (vMA) 5.1 appliances

SolusVM Easy Quick Install

Quick Easy Install Debian/Ubuntu apt update reboot wget Centos yum update reboot wget If you get an error it is because you need to install: wget Try a

vCloud user training

It is clear that a lot of vCloud users are not well trained by their vCloud providers. This is due to the fact that the current training available is for

Get 90% Discount

First 3 People gets the Bonus!
Don't Miss Out Our Big Sale

Get 0-90% On All
247Rack Services


The Sale Is Until The End Of March