Category: Windows Admin
Windows Administration Blog Archives, by Peter Whyte (Database Administrator).
Includes: Database Admin, Windows Admin, PowerShell, WSL & more…
How to Set Environment Variables in PowerShell
To get environment variables in PowerShell, we can use Get-ChildItem env: to list all the environment variables and $env: to return the value of a specific environment variable. This blog post should help explain this as well as how to set new values for Environment Variables. An environment…
How to Install PowerShell on Ubuntu 20.04
This post is a guide on installing PowerShell on Ubuntu 20.04. The Ubuntu Linux distribution being used in this demo is running as a Windows Subsystem for Linux (WSL) instance. I have not yet encountered issues with the PowerShell, Ubuntu and WSL cocktail. Be sure to check out…
Create a New Firewall Rule with PowerShell
This is a short post to share a PowerShell script that will create a new Windows Firewall Rule on a your computer. We have to ensure that we run PowerShell as Administrator for this to work. The above is creating a new firewall rule so inbound SQL Server…
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…
SQL Server Default Port
The default port for the SQL Server Engine is 1433, which is a key thing to know if you’re working as a Database Administrator (DBA), especially when managing network configurations or troubleshooting connectivity issues. In my experience, SQL Server runs on port 1433 about 95% of the time.…
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…
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…
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,…
How to Check Windows Firewall Status with PowerShell
Want to quickly check whether your Windows Firewall is enabled or disabled? This guide shows you how to use PowerShell to get the status of your local Windows Firewall for each profile. PowerShell cmdlets follow a standard format: verb-noun. The verb describes the action, and the noun specifies…
How to Enable Windows Firewall using PowerShell
Windows Firewall is an essential security feature that protects your system from unauthorized access and threats. If it has been disabled for testing or mistakenly turned off, you can quickly re-enable it using PowerShell. This guide provides a straightforward process to restore your firewall settings and ensure a…
Recent Posts
- Identify Missing & Unused Indexes in SQL Server
- SQL Server Performance Tuning: Index Fragmentation Scripts
- Show User Activity and Blocking in SQL Server
- Download and Install SQL Server Management Studio (SSMS)
- How to Check and Manage SQL Server Services
Categories
– AWS
– DBA Stories
– Linux
– MySQL
– Other
– Postgres
– PowerShell
– Redshift
– SQL Server
– Windows Server
Tags
Always On Availability Groups (AAG) (3) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (71) Database Backups & Recovery (12) Database Mirroring (2) Deleting Data (1) Error Messages (4) Git Commands (5) Importing & Exporting Data (2) Linked Servers (3) Linux Admin (2) Logging & Monitoring (1) Measuring Databases (10) Microsoft Patching (2) PowerShell Scripts (1) SQL Server Agent (4) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (14) SQL Server Network Connectivity (2) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance (5) SQL Server Permissions (1) SQL Server Processes (5) SQL Server Replication (1) SQL Server Scripts (12) Windows Admin (21) Windows Authentication (2) Windows Automation (1) Windows Events (2) Windows Firewall (4) Windows Subsystem for Linux (WSL) (20)