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
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
Thanks for the reply, can you send me the whole command please. I need to enable through PCLI.
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
$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
Mountain thanks to you, finally I can see my VM is up and running..
You're welcome
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference