Automation

 View Only
  • 1.  How to enable Ping (ICMP echo) on a guest VM

    Posted Aug 14, 2020 02:45 AM

    "Access denied" error while enabling ICMP

    Set-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -enabled True -RemoteAddress "192.168.0.5" -Protocol ICMPv4 -IcmpType 8 -Direction Inbound -Action Allow

    Any assistance that I can get would be much appreciated.

    Thank you



  • 2.  RE: How to enable Ping (ICMP echo) on a guest VM

    Broadcom Employee
    Posted Aug 14, 2020 06:44 AM

    That is a PowerShell cmdlet, you're trying to change the behaviour of Windows regardless of it running in a VM - so technically not anything to do with PowerCLI or any VMware product.



  • 3.  RE: How to enable Ping (ICMP echo) on a guest VM
    Best Answer

    Posted Aug 14, 2020 08:09 AM

    The Set-NetFirewallRule cmdlet requires the user running it to be a local administrator.

    You can allow other accounts to create/change FW rules, but that requires setting policy and permissions in the Windows OS.

    You will see the same error when you run this via the netsh command.



  • 4.  RE: How to enable Ping (ICMP echo) on a guest VM

    Posted Aug 18, 2020 07:55 AM

    I was successfully able to enable ICMP echo using below cmdlet with administrator role

    netsh advfirewall firewall set rule name="File and Printer Sharing(Echo Request - ICMPv4-In)"

    protocol=icmpv4:8,any dir=In new enable=yes

    But can we achieve this using PowerCLI cmdlet ,enabling multiple vms(Ex: IPs) simultaneously via script?



  • 5.  RE: How to enable Ping (ICMP echo) on a guest VM

    Posted Aug 18, 2020 07:58 AM

    I meant enabling ICMP echo in multiple vms using their IP's in a script?



  • 6.  RE: How to enable Ping (ICMP echo) on a guest VM

    Posted Aug 18, 2020 08:17 AM

    Is the account which you pass via Invoke-VMScript on the GuestCredential parameter a local administrator in the Guest OS?



  • 7.  RE: How to enable Ping (ICMP echo) on a guest VM

    Posted Aug 18, 2020 08:56 AM

    I tried both ways but either I get access denied error or username/pwd is incorrect.

    New-PSSession -ComputerName "VM-001" -Credential (Get-Credential) -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck)

    Enable-NetFirewallRule -DisplayName  "ICMP Allow incoming V4 echo request"

    Set-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -enabled True -RemoteAddress "192.168.0.5" -Protocol ICMPv4 -IcmpType 8 -Direction Inbound -Action Allow



  • 8.  RE: How to enable Ping (ICMP echo) on a guest VM

    Posted Aug 18, 2020 09:06 AM

    Did you try to run the netsh command inside the Guest OS via the Invoke-VMScript cmdlet?