Greetings, I'm Professor Kay. And in this short video presentation, we're going to see how we go about using the net sh command to manage our Windows Firewall on Windows Server 2019. And though I'm using Microsoft server 2019 as my platform for this demonstration, the commands I'm about to show you will work across Windows Server 2012 and server 2016. So to begin this demonstration, let's bring up the PowerShell. Now to do this, I'm just going to go to the start menu. And from the start menu, I'm going to select Windows PowerShell.
And just so that we don't have any issues, I'm going to right click, and I'm going to select from the context menu run as administrator. So one of the first things you're going to want to do is to check the current configuration of your Windows Firewall. Now to do this, we can use the following command net sh space, a dv firewall, space firewall. Show rule name equals all. Now, there's going to be a lot of information that's going to pop up here. For instance, if I just hit enter, it's going to give me a whole bunch of information that's going to pretty much overwhelm us.
So what we're going to want to do is have it show us this information one page at a time. Now to do this, I'll bring up the firewall command one more time, and I'm going to type in a pipe. That's a pipe. Now I'm going to use the word more. Now this will display the information one line at a time. This also works at the command prompt as well.
So this is a little trick that you can use when you use these PowerShell commands. And you're getting a whole lot of information running across the screen all at once, forcing you to stop and have to go back and scroll through all that information, trying to find what it is you're looking for. So now when I hit Enter, you'll notice that the information comes up one page at a time. Now from time to time you'll want to disable the Windows Firewall for troubleshooting purposes, you'll want to see if that is the issue with you not being able to establish a connection or not been able to filter something properly. Now to do this, you can use the net sh command, you can just type in the following advanced firewall space, set all profiles and set that state to off. Now when I hit Enter, it's gonna come back, just tell me Okay, now I'll hit the up arrow.
And when I'm done troubleshooting, I can just change that off to an on, and I'll hit Enter, and my firewall is back on. Now, another thing that you need to know how to do is to reset the firewall. And again, we can use the net sh command space, advanced firewall space reset to do this. So if I just type this command in at the command prompt, or the PowerShell and hit enter, it's going to come back and tell me Okay, that my firewall has been reset. And this isn't If you make changes to the firewall, and they don't seem to be working, try doing a reset. So by default, when you try to ping a domain controller, you may not be able to respond because ICMP, version four is not being allowed to travel through the firewall.
So to fix this problem, you can use net sh in the following command to allow ping to travel through your firewall on your Windows Server 2019 or even 2012 2016 and even windows 10 using the PowerShell. So you can see this command is rather long. So back inside of the course, go to their description, and you can copy and paste all these commands from with inside of the description for this particular lesson. If I hit Enter, it's going to come back and just tell me Okay, and ping is now enabled to travel both ways. So another thing we have to do with our firewall, is when we enable Remote Desktop that is Port 3389. We want to have access to that machine remotely, we're going to have to allow that access through the firewall.
And we do that using the following net sh command, advanced firewall, space firewall, space set rule, group equals remote desktop, new enable Yes, hit enter, it's going to come back and say, Hey, updated three rules. So that's going to conclude this short video presentation on how we go about using the net sh command to manage our Windows Firewall on Windows Server 2019. So if you have any questions or concerns about any of the material that was covered in this short video presentation, please do not hesitate to reach out and contact your instructor and I'll see you in my next video.