Use PowerShell to find IP Geolocation

In log files from web servers you often find strange requests. For example requests for wp-login.php on server that don’t have PHP or WordPress installed. Or that someone is requesting the same page over and over. Most of the times this is not a real problem. But it gets a problem or at least annoying when you get hundreds or thousands of these requests from the same IP address. If I see things like that happening the first step is to find out where the request is coming from. [Read More]

Edit firewall rule scope with PowerShell

One of our managed server customer frequently asked me to add an IP address to the scope of a firewall. Specially when they were still testing and did not want HTTP/HTTPS to be open for everyone. Recent versions of PowerShell have Cmdlets that you can use to manage firewall rules. To set the scope you can use Set-NetFirewallAddressFilter Cmdlet. You use it like this. Get-NetFirewallrule -DisplayName 'Test-Rule' | Get-NetFirewallAddressFilter | Set-NetFirewallAddressFilter -RemoteAddress 192. [Read More]

Disable IIS Server Headers

For security reasons some administrators want to hide what web server they are using. Personally I am not convinced that it would stop hackers to attack your server. But is is good practice to expose as little information as possible and security audits also require not to expose these pieces of information in the response headers. In this post I will show you how to disable some common and not so common headers in Windows Server 2016 and higher. [Read More]

Disable PowerShell beep on backspace

One thing that I have found very annoying of the recent PowerShell versions is the beep that you hear when you press <BackSpace> and hit the beginning of the line. First I thought it was a setting in Windows 10 but I could not find it. And apparently that is the wrong place to look for it. The beep sound is actually provided by the PSReadLine module which is used by default and also gives us these time saving keyboard shortcuts. [Read More]

PowerShell Shortcuts

Unix Shells have many shortcuts that make life easier when using the shell. What people often forget is that de good old Command Prompt also had shortcuts. HowToGeek wrote a good article about it. You can find it here. Recent versions of PowerShell also have even more powerful keyboard shortcuts. This are implemented by the PSReadLine Module. This module is included with PowerShell 5 and higher. The documentation can be found here. [Read More]