I am having problems setting up a script through task manager... My script is as follows.
------------------------------
-------------------------------
I tried running that directly through powershell aswell which returns a "Not recognized command"
I run it through the vSphere powercli shortcut on the desktop and get "Could not connect using the requested protocol."
I also tried setting the protocol using Connect-VIServer NAME-SERVER.xsclient.int -protocol https and still the same result.
Those are VMware View PowerCLI cmdlets you are trying to use.
They are not included in PowerCLI.
Are you running this on a View Connection server ?
You'll have to load the View PowerCLI snapin
You can find some more info on using the View cmdlets remotely in Alan's blog post called Using the View PowerCLI cmdlets from another machine
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I am running this on the host, i have tried jsut the name, the 127 ip and the localhost as the name
Just noticed, the Get-Desktop cmdlet does in fact not exist, don't you mean to do a Get-Pool there ?
Something like
Get-Pool -pool_id TEST | Get-DesktopVM | Send-LinkedCloneRefresh -schedule $a
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ahh yes...
I think i would have noticed that down the line, however my problem occurs at the begining and it seems to be something i dont have installed or configured correctly.
When i type the first command manually i get "Could not connect using the requested protocol." I tried adding -protocol https but this did not work as well.
EDIT
Also added the -credential (Get-Credential) same story
I added a screenshot of the error
It looks as if the HTTPS protocol doesn't get through.
Try with explicitely specying -Protocol http.
Do you run the vCenter on a Windows server that has an active firewall ?
Can you try switching off that FW for a test ?
If it works then, you will have to make sure port 442 and 902 are open.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Server is in production, so i will open those ports and try with only http.
I've been having this problem on and off for years and couldn't figure out what was going on. For me the it turns out the problem was the proxy settings in internet explorer. Disabled the proxy and all is working again.
Have a look at the ProxyPolicy parameter on the Set-PowerCLIConfiguration cmdlet.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference