VMware Cloud Community
Masi45673
Contributor
Contributor

Network Adapter

Hello people,

My VM Microsoft 2016 Ethernet adapter was disabled accidentally by someone, now the issue is that VM is having MFA, I cannot pass authentication on it until the VM is able to see network connectivity. The network adapter is connected on VM setting but disabled inside the VM. Can anyone help me on how can I enable that ethernet adapter?

TIA

Reply
0 Kudos
5 Replies
LucD
Leadership
Leadership

If you have the VMware Tools running in the guest OS, you can use the Invoke-VMScript cmdlet to run something like a 'netsh int set int name="Local Area Connection" admin=enabled' command.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Masi45673
Contributor
Contributor

Thanks for the reply, can you send me the whole command please. I need to enable through PCLI.

Reply
0 Kudos
LucD
Leadership
Leadership

Sure, not that you need to provide a user and password for a user that is authorised to give that command in the guest OS.
It also assumes that your network connection inside the guest OS is named 'Local Area Connection'.

If it is not, you list the network connections with command 'netsh int show interface' (same script, just change the variable $cmd).

Than you could do something like this

$vmName = 'MyVM'

$user = 'user'

$pswd = 'password'

$cmd = @'

netsh int set int name="Local Area Connection" admin=enabled

'@


$sINvoke = @{

   VM = $vmName

   ScriptText = $cmd

   ScriptType = 'Bat'

   GuestUser = $user

   GuestPassword = $pswd

}

Invoke-VMScript @sInvoke


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Masi45673
Contributor
Contributor

Mountain thanks to you, finally I can see my VM is up and running.. Smiley Happy

Reply
0 Kudos
LucD
Leadership
Leadership

You're welcome Smiley Happy


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos