Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 49146

Exception has been thrown by the target of an invocation Windows Server 2016

$
0
0

Hello folks , I am stuck 

 

I am running a simple command 

 

Import-Module "VMware.VimAutomation.Core"

Connect-VIServer something.something.vcenter1

 

$vms = Import-CSV D:\Scripts\~\adhoc.csv

 

foreach ($vm in $vms){

 

$vmn = $vm.vmname

Invoke-VMScript -vm $vmn -ScriptText "ping something.something" -GuestUser $GuestCred -GuestPassword $GuestPass -ScriptType Bat

 

}

 

I am getting the follow error:

 

Invoke-VMScript : 3/5/2019 7:45:31 PM    Invoke-VMScript        Exception has been thrown by the target of an invocation.   

At D:\Scripts\~\dr_adhoc.ps1:90 char:9

+ Invoke-VMScript -vm $vmn -ScriptText "ping something.something" -GuestU ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Invoke-VMScript], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.InvokeVmScript

 

If I run the same command on a non windows 2016 it works without any problem I am curios if it is something else


Viewing all articles
Browse latest Browse all 49146

Trending Articles



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