I created a NetworkAdapter with "New-NetworkAdapter", and got this:
ConnectionState: Connected, NoGuestControl, StartConnected
How can I change it to "Connected, GuestControl, StartConnected"?
With the New-NetworkAdapter cmdlet you can just add the StartConnected switch.
If the VM powers on, te vNIC will be connected.
When the vNIC is already created, you can use the Set-NetworkAdapter cmdlet.
You can use the Connected switch, to connect it immediately, provided the VM is powered on.
See Example 3.
Otherwise, when the VM is not powered on, use the StartConnected switch.
You will first have to do a Get-NetworkAdapter and pass the object over the pipeline to Set-NetworkAdapter.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I can know that.
What I do not know is the difference between GuestControl and NoGuestControl in ConnectionState, and
how to change NoGuestControl to GuestControl.
I want to change it.
The GuestControl setting defines if a device can be connected/disconnected from within the guest OS with the VMwareToolboxCmd.
To enable this is a serious potential security risk.
See for example Brian's post VM with multiple vNics could be a security risk
It is strongly advised to disable these possibilities.
See Prevent a Virtual Machine User or Process from Disconnecting Devices
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can't switch between NoGuestControl and GuestControl from a PowerCLI cmdlet.
You will have to change the VMX entries (if needed) and the use the ReconfigVM method to change the device setting.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference