5 Replies Latest reply on Jun 2, 2019 12:58 AM by LucD

    Network Adapter

    Masi45673 Novice

      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

        • 1. Re: Network Adapter
          LucD Guru
          vExpertCommunity WarriorsUser Moderators

          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: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: Network Adapter
            Masi45673 Novice

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

            • 3. Re: Network Adapter
              LucD Guru
              vExpertCommunity WarriorsUser Moderators

              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: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              • 4. Re: Network Adapter
                Masi45673 Novice

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

                • 5. Re: Network Adapter
                  LucD Guru
                  User ModeratorsCommunity WarriorsvExpert

                  You're welcome

                  Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz