VMware Cloud Community
fborges555
Enthusiast
Enthusiast
Jump to solution

Disable firewall on VM

Hi gurus

 

Can I use Powercli to disable firewall on a VM?

 

Thanks

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Just send the following through Invoke-VMScript

Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled False

But be aware that you need administrator credentials to do that.
And UAC might not allow you to run elevated commands


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

View solution in original post

0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

You mean a FW inside the Guest OS on the VM?


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

0 Kudos
fborges555
Enthusiast
Enthusiast
Jump to solution

Yes 

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Well, that of course depends on the sort of Guest OS.
Most of these have a command to do that.
And, when the VMware Tools are installed, you can execute that command via Invoke-VMScript.


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

0 Kudos
fborges555
Enthusiast
Enthusiast
Jump to solution

L.

 

they are all Windows 2019 and VM tools 11 install

 

Thanks again for the help

 

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Just send the following through Invoke-VMScript

Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled False

But be aware that you need administrator credentials to do that.
And UAC might not allow you to run elevated commands


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

0 Kudos