firewalljpg

Tired of old point and click interface? :) Powershell is the new purple in computer world :) haha…Seriously! :)

So, here’s a little script that will add the Ip address you want to the existing firewall rule.

As you can see, it fairly simple, and there’s no need to explain it too much….


Function IP
{
param ($ipadress = $(Read-host "Enter IP address"))
$rule = "YOUR PREVIOUSLY CREATED RULE NAME"
Write-host "Adding address :" $ipadress -foregroundcolor "Red"
Start-sleep -s 5
netsh advfirewall firewall set rule name="$rule" new remoteip="$ipadress" action="allow"
}
IP

Only thing you have to do in the script is to enter your fireall rule name.

When you start the script, it  will ask you to enter desired ip address, and press enter. After that, wait 5 seconds and thats it :)

Cheers!