Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The last time I stepped into the GUI to block a 'intrusion-attempting' IP I mucked up my remote access due to a misclick. Would like to avoid that again.

Looking for either a direct-from-cmd command or powershell script that will block all incoming attempts from a given IP.


share|improve this question
up vote 2 down vote accepted

In newer version of Windows (Server 2012 R2 or Windows 8+) you should use Powershell as netsh is deprecated:

share|improve this answer

try "netsh advfirewall firewall". The displayed help-text will fill you up with what you are looking for.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.