PowerShell

SQL Server SPNs and Kerberos: a practical, end-to-end guide

Intro If Windows logins to SQL Server keep falling back to NTLM, linked servers fail with “Login failed for user NT AUTHORITY\ANONYMOUS LOGON,” or you see SSPI handshake messages in the error log, you probably have a Service Principal Name (SPN) problem. This guide explains what SPNs are, how SQL Server uses them with Kerberos, […]

SQL Server SPNs and Kerberos: a practical, end-to-end guide Read More »

Windows + SQL Server: Building a Weekly Health Check with PowerShell

Every DBA needs a predictable way to keep both Windows and SQL Server systems healthy. Instead of juggling GUIs, Task Scheduler jobs, and one-off commands, a single PowerShell health check script can handle your daily or weekly routines consistently. This post walks through: The script is fully commented and written with original function names so

Windows + SQL Server: Building a Weekly Health Check with PowerShell Read More »

SQL Server TempDB Files: How Many, Why, and When to Add More

Introduction TempDB is one of the most critical system databases in SQL Server. It handles temporary objects, version stores, work tables, spills from insufficient memory, sorts, CTEs, and much more. Because it’s a shared workspace for every database on the instance, misconfiguration can lead to bottlenecks that impact your entire workload. One of the most

SQL Server TempDB Files: How Many, Why, and When to Add More Read More »

Proactive SQL Replication Monitoring: Errors, Backlog, and Smart Email Alerts

Replication is great until it gets quiet and drifts out of sync. The fix is simple: collect errors and backlog on a schedule, keep a local audit trail, and email the team only when action is needed. This guide gives you a full solution you can paste into SSMS and run. You will: What you

Proactive SQL Replication Monitoring: Errors, Backlog, and Smart Email Alerts Read More »

⚙️ PowerShell for SQL Server DBAs: Top Commands and Automation Scripts You Should Be Using

As a SQL Server DBA, you’ve probably automated a few tasks with SQL Agent or T-SQL, but PowerShell — especially with DBATools.io — takes your DBA game to the next level. Whether you’re managing backups, restoring databases, monitoring performance, or migrating servers, PowerShell makes it repeatable, scriptable, and scalable. This post breaks down the most

⚙️ PowerShell for SQL Server DBAs: Top Commands and Automation Scripts You Should Be Using Read More »

Get drive letter (Device ID), Drive size, drive free space and drive free space %

Get-WmiObject Win32_logicaldisk -ComputerName ADD Your Server Name ` | Format-Table DeviceID, ` @{Name=”Drive Size(GB)”;Expression={[decimal](“{0:N0}” -f($_.size/1gb))}}, ` @{Name=”Drive Free Space(GB)”;Expression={[decimal](“{0:N0}” -f($_.freespace/1gb))}}, ` @{Name=”Drive Free pct”;Expression={“{0,6:P0}” -f(($_.freespace/1gb) / ($_.size/1gb))}} ` -AutoSize 

Get drive letter (Device ID), Drive size, drive free space and drive free space % Read More »