vSphere 6.0
PowerCLI 6.0R3
Guest VMs: Windows 2008R2, Windows Server 2012R2
Initial vmtools version: 9349
I have an Invoke-VMScript command that has been working on these VMs to set a service's startuptype to manual. I was seeing the message that vmtools was out of date, but my script completed successfully. I updated vmtools on the VMs to 9541. The same script now fails with "A specified parameter was not correct" error. Any ideas?
The script section:
$thisvm = Get-VM -Name $vmname
$script = "Set-Service `"$svcname`" -startuptype `"$startuptype`""
$result = Invoke-VMscript -ScriptText $script -vm $thisvm -GuestCredential $mycreds -ScriptType Powershell
Full error text:
Invoke-VMscript : 2/5/2016 9:09:05 AM Invoke-VMScript A specified
parameter was not correct:
At C:\powercli\MAGtest.ps1:58 char:11
+ $result = Invoke-VMscript -ScriptText $script -vm $thisvm -GuestCredential
$mycr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-VMScript], InvalidArgu
ment
+ FullyQualifiedErrorId : Client20_VmGuestServiceImpl_RunScriptInGuest_ViE
rror,VMware.VimAutomation.ViCore.Cmdlets.Commands.InvokeVmScript
$guestuser = ".\administrator"
To this:
$guestuser = "administrator"
My VMs are not members of a domain. Earlier this week when I was first trying Copy-VMGuestFile, I tried using "administrator" without the “.\” and I could not connect. I added the “.\” and it worked. Odd that a vmtools upgrade would break it, but...
Are there anymore clues in the vmware.log ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
$guestuser = ".\administrator"
To this:
$guestuser = "administrator"
My VMs are not members of a domain. Earlier this week when I was first trying Copy-VMGuestFile, I tried using "administrator" without the “.\” and I could not connect. I added the “.\” and it worked. Odd that a vmtools upgrade would break it, but...