Those are 2 completely different requirements.
Changing the vNIC type can be done with the Set-NetworkAdapter cmdlet and the Type parameter.
Configuring the IP settings inside the Guest OS depends on the Guest OS.
You can, if the VMware Tools are installed, use the Invoke-VMScript cmdlet to run a script inside the Guest OS.
But which script depends on the type of Guest OS.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Those are 2 completely different requirements.
Changing the vNIC type can be done with the Set-NetworkAdapter cmdlet and the Type parameter.
Configuring the IP settings inside the Guest OS depends on the Guest OS.
You can, if the VMware Tools are installed, use the Invoke-VMScript cmdlet to run a script inside the Guest OS.
But which script depends on the type of Guest OS.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for the Reply @LucD
the Set-NetworkAdapter cmdlet, will it affect the IP configuration on the OS level.
No, but changing the vNIC type will inside the Guest OS make the NIC appear appear as a new NIC, and hence all settings will be lost.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
do you have any script that can use Invoke-VMScript also for the ip configuration part.
Thanks in Advance 🙏
The script to use depends on what kind of Guest OS you have running on the VM.
And there are quite a few examples available for both Windows and Linux in this community.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Got that @LucD,
I will check and work on the same.
correct if I'm wrong on the flow mentioned below or if I miss something.
we have VMs on both(WIN and Linux),
That flow is correct.
You will need Windows and Linux versions of the scripts used in 1 and 3.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference