Blog Posts
Everything published on this blog since 2017, newest first. The SQL Server writing now lives at sqldba.blog.
Guides: Claude Code · PowerShell · WSL · Windows
-
Create a Firewall Rule with PowerShell (New-NetFirewallRule)
Create a Windows Firewall rule with New-NetFirewallRule, check it with Get-NetFirewallRule, then change, disable or remove it, with the SQL Server rules a DBA actually needs.
-
Add a Filegroup to a Database in SQL Server
This post contains a demo on how to add a new Filegroup for a database in SQL Server. Most databases work well with single data/log files and do not need this.
-
How to Check Your PowerShell Version ($PSVersionTable)
Run $PSVersionTable.PSVersion to check your PowerShell version. What the output looks like in Windows PowerShell 5.1 and PowerShell 7, why $host.Version can mislead, and how to check a script or a remote machine.
-
How to Run PowerShell Scripts with Task Scheduler
Automating PowerShell scripts is a much needed task for Windows Administrators. The Task Scheduler provides a reliable way to execute scripts on a predefined…
-
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.
-
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 good option. We use this to send […]
-
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…
-
PowerShell For Each Loop Example
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…
-
Get Estimated Database Backup/Restore Example
When you're waiting on a database backup or restore to complete in SQL Server, we can run the script below to get an estimated time of how long the backup has…