Author Archives: bolt

Finding the first (default) IPv4 gateway in a Windows batch script

I recently had to whip out my batch scripting skills to grab the default gateway for a routing script. Here’s what I ended up with: route print | findstr /R /C:”^[ ][ ]*[ ]” | for /f “tokens=3” %%i in (‘more’) do (echo %%i & exit) >gw.tmpset /P gw=<gw.tmpdel gw.tmpecho “%gw%” This does, unfortunately, use […]

Who deleted the files from the Windows file server?

Classic whodunit – the file is gone. Who deleted it? Well, unless you’ve already prepared for this, Windows has no log for you. Sorry. The good news is that this is an excellent time to prepare for the next time. So let’s do that. Enable the auditing of file operations to the Windows Event Log […]

Enable remote management of Windows Server Core and Hyper-V Core

This is a reference for the commands to enable the firewall rules necessary to remotely manage Windows Server Core and Hyper-V Core. I keep having to look these up… Enable-NetFireWallRule -DisplayName “Windows Management Instrumentation (DCOM-In)” Enable-NetFireWallRule -DisplayGroup “Remote Event Log Management” Enable-NetFireWallRule -DisplayGroup “Remote Service Management” Enable-NetFireWallRule -DisplayGroup “Remote Volume Management” Enable-NetFireWallRule -DisplayGroup “Remote Scheduled […]

Forcing Cygwin to create sane permissions on Windows

If you use Cygwin to mainly manipulate files in your regular Windows filesystem, under /cygdrive/…, you have probably seen this message more than a few times: “The permissions on <node> are incorrectly ordered, which may cause some entries to be ineffective” You have also likely seen “NULL SID” as the top entry in permission lists. […]

Using external Certificate Authority certificates in a restricted or closed environment

In this example, we’ll be using a wildcard certificate from Let’s Encrypt, obtained through their recently released wildcard certificate offering. What we’re doing The use case is that we want, for one reason or another, to use this certificate in an environment that does not have unrestricted internet access, such as a health institution or […]