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

Set-VMGuestnetworkinterface errors

$
0
0

Long story short, I need to change IPs of 150 VMs. I've been able to get the Set-VMGuestnetworkinterface to work for the most part, but I have 2 questions.

 

First the code!

$myVM1 = Get-VM -Name "mockup AD"

$interface = Get-VMGuestNetworkInterface -VM $myVM1 -GuestUser administrator -GuestPassword password

$guest = Get-VMGuest $myVM1

$interface = Get-VMGuestNetworkInterface -VMGuest $guest -GuestUser administrator -GuestPassword password

Set-VMGuestNetworkInterface -VMGuestNetworkInterface $interface -GuestUser administrator -GuestPassword password -IPPolicy static -IP 192.168.0.250 -Gateway 192.168.0.1 -Dns ("192.168.0.250", "192.168.0.2")

 

Question 1: I can only successfully run these commands passing the client's local administrator account. If I don't it comes back with:

 

Set-VMGuestNetworkInterface : 4/5/2013 1:47:25 PM    Set-VMGuestNetworkInterfac
e        "Error occured while configuring the network:'The requested operation
requires elevation (Run as administrator).
Access is denied.
The requested operation requires elevation (Run as administrator).
The requested operation requires elevation (Run as administrator).
'.
At line:1 char:28
+ Set-VMGuestNetworkInterface <<<<  -VMGuestNetworkInterface $interface -GuestU
ser test\ttest -GuestPassword password -IPPolicy static -IP 192.168.0.251 -Gate
way 192.168.0.1 -Dns ("192.168.0.2", "192.168.0.250")
    + CategoryInfo          : InvalidArgument: (:) [Set-VMGuestNetworkInterfac
   e], ViError
    + FullyQualifiedErrorId : Client20_VmGuestService_SetVmGuestNetworkInterfa
   ce_Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetVmGuestNetworkInt
  erface

Set-VMGuestNetworkInterface : 4/5/2013 1:47:43 PM    Set-VMGuestNetworkInterfac
e        "Error occured while configuring the network:'The requested operation
requires elevation (Run as administrator).
Access is denied.
The requested operation requires elevation (Run as administrator).
The requested operation requires elevation (Run as administrator).
'.
At line:1 char:28
+ Set-VMGuestNetworkInterface <<<<  -VMGuestNetworkInterface $interface -GuestU
ser test\ttest -GuestPassword password -IPPolicy static -IP 192.168.0.251 -Gate
way 192.168.0.1 -Dns ("192.168.0.2", "192.168.0.250")
    + CategoryInfo          : InvalidArgument: (:) [Set-VMGuestNetworkInterfac
   e], ViError
    + FullyQualifiedErrorId : Client20_VmGuestService_SetVmGuestNetworkInterfa
   ce_Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetVmGuestNetworkInt
  erface

Set-VMGuestNetworkInterface : 4/5/2013 1:48:01 PM    Set-VMGuestNetworkInterfac
e        "Error occured while configuring the network:'The requested operation
requires elevation (Run as administrator).
Access is denied.
The requested operation requires elevation (Run as administrator).
The requested operation requires elevation (Run as administrator).
'.
At line:1 char:28
+ Set-VMGuestNetworkInterface <<<<  -VMGuestNetworkInterface $interface -GuestU
ser test\ttest -Guestpassword password -IPPolicy static -IP 192.168.0.251 -Gate
way 192.168.0.1 -Dns ("192.168.0.2", "192.168.0.250")
    + CategoryInfo          : InvalidArgument: (:) [Set-VMGuestNetworkInterfac
   e], ViError
    + FullyQualifiedErrorId : Client20_VmGuestService_SetVmGuestNetworkInterfa
   ce_Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetVmGuestNetworkInt
  erface

 

I've attempted to run these commands using a domain admin account formatted as "test\ttest" but have also attempted "test.lab.local\ttest" as well as the domain account placed right into the administrators group on the test server with no luck. I'm pretty sure this is due to the UAC and I'd prefer not disabling UAC on all our servers. Any ideas getting around this?

 

2)  When the commands are issued, and it succeeds to change everything that I've specified but generates the following errors:

 

Set-VMGuestNetworkInterface : 4/5/2013 12:41:37 PM    Set-VMGuestNetworkInterfa

ce        "Error occured while configuring the network:'Element not found.

'.

At line:1 char:28

+ Set-VMGuestNetworkInterface <<<<  -VMGuestNetworkInterface $interface -GuestU

ser administrator -GuestPassword password -IPPolicy static -IP 192.168.0.250 -G

ateway 192.168.0.1 -Dns ("192.168.0.250", "192.168.0.2")

    + CategoryInfo          : InvalidArgument: (:) [Set-VMGuestNetworkInterfac

   e], ViError

    + FullyQualifiedErrorId : Client20_VmGuestService_SetVmGuestNetworkInterfa

   ce_Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetVmGuestNetworkInt

  erface


Set-VMGuestNetworkInterface : 4/5/2013 12:41:56 PM    Set-VMGuestNetworkInterfa

ce        "Error occured while configuring the network:'Element not found.

'.

At line:1 char:28

+ Set-VMGuestNetworkInterface <<<<  -VMGuestNetworkInterface $interface -GuestU

ser administrator -GuestPassword password -IPPolicy static -IP 192.168.0.250 -G

ateway 192.168.0.1 -Dns ("192.168.0.250", "192.168.0.2")

    + CategoryInfo          : InvalidArgument: (:) [Set-VMGuestNetworkInterfac

   e], ViError

    + FullyQualifiedErrorId : Client20_VmGuestService_SetVmGuestNetworkInterfa

   ce_Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetVmGuestNetworkInt

  erface

 

I know it's successful, but I'd prefer elminate these errors.

 

Thanks for the look!


Viewing all articles
Browse latest Browse all 240675

Trending Articles



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