Author: Peter Whyte

  • How to Enable CDC in SQL Server

    This is a post on how to enable Change Data Capture (CDC) in SQL Server. Enabling this on a database and table will allow the recording of activity when tables and rows have been modified. This is a feature available for us to configure within SQL Server and…

    Read More


  • How to Automate PowerShell Scripts with Task Scheduler

    Running PowerShell scripts on a schedule is a common requirement for Windows Admins. This guide will show you how to automate your scripts using Task Scheduler, covering both the GUI and PowerShell methods. Task Scheduler allows you to run programs, scripts, or other tasks based on a schedule…

    Read More


  • SQL Server Default Port

    The default port for the SQL Server Engine is 1433, which is a useful thing to know if you’re working as a Database Administrator (DBA) or Database Reliability Engineering (DBRE) type role. Though-out my career I’ve seen SQL Server run on the default 1433 port 99% of the…

    Read More


  • Connecting to SQL Server on Another Domain

    This post contains a guide on how to connect to SQL Server with Windows Authentication, but using a different Domain User other than your own. The regular Windows SQL Server User connects & runs their queries via SQL Server Management Studio (SSMS). If you’re in a corporate environment,…

    Read More


  • Restart Services on Multiple Hosts using PowerShell

    In this post, we’ll walk through a script that restarts services on multiple remote hosts using PowerShell. A single PowerShell command will be run on several computers at the same time. If you need to run a command on multiple remote machines, the PowerShell Invoke-Command cmdlet is a…

    Read More


  • How to Rename a Computer that Hosts SQL Server

    When changing the hostname of a computer that is running SQL Server, we have to update system metadata so that remote connections and applications do not lose connectivity. The hostname system metadata is stored in sys.servers and reported by @@SERVERNAME. This post is a guide on how to update…

    Read More


  • PowerShell ForEach Loop Tutorial

    Looping is a fundamental concept in PowerShell, and in programming in general. It’s needed for various situations where we need to work with one object at a time within an array/collection of objects. Microsoft’s documentation on this, about Foreach : Microsoft Documentation, describes Foreach to be for ‘stepping…

    Read More


  • How to Check Listening Ports on Windows

    This guide will show you how to check which service is running on a specific TCP or UDP port on a Windows computer. This can be useful for verifying which service is tied to a port or proactively checking for any dodgy (suspicious) open ports. In this post,…

    Read More


  • Get All Database Sizes in SQL Server

    Measuring databases is important for knowing how much disk space a SQL Server requires today, as well as the future growth of the database files. It takes more than one run of a script to know all your disk provisioning needs. The script below in this post helps…

    Read More


  • How to Backup a SQL Server Database

    This guide provides a simple demo on how to back up a SQL Server database and explains three main types of backups in MS SQL: > SQL Server Full Backup > SQL Server Transaction Log Backup > SQL Server Differential Backup > Additional Notes on SQL Server Backups…

    Read More