VMware Cloud Community
ben_973
Contributor
Contributor

[Network Remote Creation ==> KO] powershell remote session using a cascade of Invoke-Command - KO

 

Hello Guys

I face a strange behavior to customize by 2 remotes sessions my VM under VMWare Wokstation.

ARCHITECTURE : My laptop raise a Python scirpt to create, fine tune my VMs. 

=> my latop  open an Invoke-Command to the computer where I have my big computer passing "him" a PS script. 

==> My script from this machine Open session to the VMServer. 

Then I do what I want....on my VMs...

But when I try to update on the VM the network from my laucnhing my python from my laptop nothing is updated

Obvioulsy I tried the command from the  big computer : No issue ; it works. But not when I add a remote sessions additionnaly.

My Scipting is executing  like this from my python laptop:

Invoke-Command -ComputerName 10.234.36.xxx -Credential Admin_Login -FilePath C:\\Users\\SESA160396\\Desktop\\VM1.ps1

 

Content of my PS Script

##I connect to my VMWare Server 

Connect-VIServer 192.168.60.21x -User administrator@vsphere.local -Password xxxpwdxxr

Invoke-VMScript -VM CREATION_1 -ScriptType Powershell -ScriptText 'New-NetIPAddress –IPAddress 192.88.2.50 -DefaultGateway 192.88.2.211 -PrefixLength 24 -InterfaceIndex 9' -GuestUser local.company -GuestPassword Passxxx -RunAsync

 

Again i insist but running blue command from the BIG computer : WORK fine. 

Also : Running other invoke-VMScript on the same VM works : like : Adding folder ; changing hostname... etc... 

==> But not this damned network modification on this interface index...

I hope this is quite clear ; sounds like the movie INCEPTION ! 

 

 

 

0 Kudos
0 Replies