We have been using these commands which have been working for a long time. We recently upgraded few Windows server's hardware version to 13. Due to that, following three commands no longer works for any VMs which are at hardware version 13(It works fine for all other VMs which are at hardware version 11, 9, 8, 7)
1.
Import-CSV $ImportName | ForEach-object {Set-NetworkAdapter -NetworkAdapter ( Get-NetworkAdapter $_.Name ) -NetworkName $VLAN -StartConnected $Connectivity -confirm:$false}
Here is the Error:
----------------------------------------------------
Get-NetworkAdapter : 3/4/2019 11:08:25 AM Get-NetworkAdapter Exception has been thrown by the target of an invocation.
+ Import-CSV $ImportName | ForEach-object {Set-NetworkAdapter -NetworkAdapter ( Ge ...
+ ~~
+ CategoryInfo : NotSpecified: (:) [Get-NetworkAdapter], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.GetNe
tworkAdapter
2.
$Servers | ForEach-object { Get-VM (Get-VM -Name $_.Name) | Get-VMQuestion | Set-VMQuestion -Option $Option -Confirm:$false}
Here is the Error:
----------------------------------------------------
Set-VMQuestion : 3/4/2019 11:11:30 AM Set-VMQuestion Exception has been thrown by the target of an invocation.
+ $Servers | ForEach-object { Get-VM (Get-VM -Name $_.Name) | Get-VMQuestion | Se ...
+ ~~
+ CategoryInfo : NotSpecified: (:) [Set-VMQuestion], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetVMQuestion
3.
Import-CSV $ImportName | ForEach-object { Remove-VM $_.Name -Confirm:$false }
Here is the Error:
----------------------------------------------------
Remove-VM : 3/4/2019 11:45:59 AM Remove-VM Exception has been thrown by the target of an invocation.
+ Import-CSV $ImportName | ForEach-object { Remove-VM $_.Name -Confirm:$false }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Remove-VM], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.RemoveVM
Any suggestions / thoughts will be appreciated. thank you in advance.
Thank you!!!!!