The VMware View dashboard doesn't offer a built-in way to schedule a desktop pool refresh. As an administrator, you'll often want to schedule these types of activities for after business hours or during maintenance windows. Here's a PowerCLI script that lets you schedule VMware View pool refreshes on a one-time or periodic basis.<!--more-->

Here's the whole script. Lines are marked with a number and parenthesis to avoid confusion with text wrapping.
<pre>1) Add-PSSnapin VMware.View.Broker
2) Connect-VIServer &lt;your View Connection Server hostname&gt;
3) $a = get-date ((get-date).AddMinutes(2)) -format "yyyy-MM-%d HH:mm"
4) Get-Pool -pool_id &lt;your pool ID&gt; | Get-DesktopVM | Send-LinkedCloneRefresh -schedule $a</pre>
Let's step through each line of the script and dig into what it does. Since this is a Powershell script, the first line needs to import the VMware View snapins for Powershell.

Line 2 logs the script in to your View Connection Server. To avoid saving a password in cleartext in the script, we'll have Windows store the credentials for the account this script will run as (more on that later).

The third line assigns the $a variable a time reference that is two minutes in the future. The specific formatting modifies the native Get-Date result into the time format that the next line is expecting. yyyy is a 4 digit year, MM is the numeric month with leading zeroes where appropriate, %d is the numeric day of the month without leading zeroes, HH is the hours in a 24-hour clock format, mm is the minutes past the hour. Be careful - almost all these tokens are case-sensitive (e.g. MM vs. mm).

The last line actually schedules the View Pool refresh for two minutes in the future using the variable we just built and formatted. You can find your View Pool ID listed in your View Connection Server.

Save all this text in text file with a .ps1 extension to let the system know it's a Powershell script. Add a new task to Task Scheduler on your View Connection Server.