How to open Windows Firewall ports using PowerShell
How to open Windows Firewall ports using PowerShell
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
Get-CimInstance, Get-Help *Firewall*, Get-WmiObject, Powershell, Windows Firewall, WMI, WMI RPC
A Simple Introduction to Cisco CML2
0 3850 0Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2
Creating Dynamic DNS in Network Environments
0 626 1This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader teaches how to create Dynamic DNS zones in Network Environments. Video Transcription: Now that we’ve installed DNS, we’ve created our DNS zones, the next step is now, how do we produce those … Continue reading Creating Dynamic DNS in Network Environments
Cable Testers and How to Use them in Network Environments
0 713 1This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader demonstrates how to use cable testers in network environments. Let’s look at some tools that we can use to test our different cables in our environment. Cable Testers Properly Wired Connectivity … Continue reading Cable Testers and How to Use them in Network Environments