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 0 Jason 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 Helmick
Systems Instructor
Interface Technical Training

Videos You May Like

Configuring Windows Mobility Center and How to Turn it On and Off

1 1385 1

Video transcription Steve Fullmer: In our Windows training courses, we often share information about the Windows 8.1 Mobility Center. Mobility Center was introduced for mobile and laptop devices in Windows 7. It’s present and somewhat enhanced in Windows 8. Since we don’t have mobile devices in our classrooms, I decided to take a little bit … Continue reading Configuring Windows Mobility Center and How to Turn it On and Off

Agile Methodology in Project Management

0 185 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

Creating Users and Managing Passwords in Microsoft Office 365

0 809 5

In this Office 365 training video, instructor Spike Xavier demonstrates how to create users and manage passwords in Office 365.   For instructor-led Office 365 training classes, see our course schedulle: Spike Xavier SharePoint Instructor – Interface Technical Training Phoenix, AZ 20347: Enabling and Managing Office 365    

Write a Comment

Share your thoughts...

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