Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 193198

NEed some help with pool refresh scheduled task using powercli

$
0
0

I am trying to set up a nightly refresh of a pool of VMs using a PS script and view CLI.

The script is set up and working. I can run it through powercli and have it refresh the pools manually.... Where im running into issues is when i try to run the script from the actual task.

here is the script

Connect-VIServer vCLIENT-vcenter1.SERVER.int $a = get-date ((get-date).AddMinutes(0)) -format "yyyy-MM-%d >HH:mm" Get-Pool -pool_id TEST | Get-DesktopVM | Send-LinkedCloneRefresh -schedule $a -forcelogoff $true -stoponerror $true

When i schedule the task i put the executable program as:

C:\Windows\system32\windowspowershell\v1.0\powershell.exe

Ive tired setting the paramaters to:

-noe -c ". \"D:\Program Files\VMware\VMware View\Server\extras\PowerShell\add-snapin.ps1\"" & C:\Scripts\Nightly.Refresh.ps1

But it times out in the scheduled tasks and hangs. I have to stop the task.

Does anyone know what the correct parameters should be?


Viewing all articles
Browse latest Browse all 193198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>