How to open Windows Firewall ports using PowerShell

Home > Blogs > PowerShell > How to open Windows Firewall ports using PowerShell

How to open Windows Firewall ports using PowerShell

Like This Blog 0Jason Helmick
Added by April 15, 2013

Recently I presenting at a conference and needed to demonstrate WMI. I specifically wanted to use the Get-WmiObject cmdlet instead of the new Get-CimInstance cmdlet because I wanted the demo to be useful for those still running PowerShell V2. All my remote computers are running Server 2012 and already have PowerShell Remoting enabled, so the PowerShell Remoting portion of the demonstration worked just fine, but when I tested my WMI demonstration the firewall on the remote computers blocked the WMI RPC calls. Since I needed to open the ports for WMI, why not use PowerShell Remoting and the new cmdlets for the firewall rules.

PS>Invoke-Command –ComputerName <remoteservers> {Enable-NetFirewallRule -name WMI-WinMgmt-In-TCP, WMI-RPCSS-In-TCP} 

Worked like a charm!

By the way, you should check out the firewall management cmdlets. Start with Get-Help *Firewall* and explore!

 

Knowledge is PowerShell,

Jason

Jason Helmick
Systems Instructor
Interface Technical Training

You may also like:  Methods to Enable and Disable Remote Desktop Locally

Videos You May Like

Agile Methodology in Project Management

0 74 0

In this video, you will gain an understanding of Agile and Scrum Master Certification terminologies and concepts to help you make better decisions in your Project Management capabilities. Whether you’re a developer looking to obtain an Agile or Scrum Master Certification, or you’re a Project Manager/Product Owner who is attempting to get your product or … Continue reading Agile Methodology in Project Management

How to clone a Windows Server 2012 or 2012 R2 Domain Controller

1 614 2

One of the coolest new features in Window Server 2012 and Windows Server 2012 R2 is the ability to clone a Domain Controller. In the past, if we had virtualized Domain Controllers and we actually took a snapshot of it and then rolled back to that snapshot, it would break the logon service on that … Continue reading How to clone a Windows Server 2012 or 2012 R2 Domain Controller

Detailed Forensic Investigation of Malware Infections – April 21, 2015

2 271 3

In this IT Security training video, Security expert Mike Danseglio (CISSP / CEH) will perform several malware investigations including rootkits, botnets, viruses, and browser toolbars.

Write a Comment

Share your thoughts...

Please fill out the comment form below to post a reply.