Disable Local User Accounts in Windows with GPO and PowerShell

Best security practices for Windows domain networks recommend disabling local user accounts on computers and servers in an Active Directory domain. Local users who have administrative permissions on a computer can be a weak point in the security of your network. You can use tools such as Windows LAPS (Local Administrator Password Solution) to set unique, complex passwords for local administrators, or you can use AD Group Policies to completely disable local administrator and user accounts.

Continue reading “Disable Local User Accounts in Windows with GPO and PowerShell”

Move Hyper-V VMs Between Hosts Using Live Migration

The Live Migration feature in Hyper-V allows you to migrate a running virtual machine between hosts with almost no downtime. Initially, Live Migration in Hyper-V was only available as part of a Windows failover cluster with CSV shared storage. Starting with Windows Server 2012, Hyper-V Live Migration doesn’t require a cluster and shared storage. To migrate VMs, Hyper-V hosts need to be connected using a fast shared Ethernet network. This type of migration is called a Shared-nothing live migration.

Continue reading “Move Hyper-V VMs Between Hosts Using Live Migration”

Understanding IF, ELSE Statements in PowerShell

Logical statements If, Else, and ElseIf are used in PowerShell to check various conditions. The If statement is used to check a condition and perform a particular action if the condition is true. If the condition is not true (FALSE), you can use Else or ElseIf to perform another action.

Continue reading “Understanding IF, ELSE Statements in PowerShell”

Converting a PowerShell (PS1) Script to an EXE File

A separate *.ps1 extension is used for PowerShell script files. To run PS1 scripts, users must open a PowerShell console, cmd, or code editor (such as PowerShell ISE or VSCode). If you want your users to be able to easily run your PowerShell scripts, you can convert PS1 files to the .exe executable file format.

Continue reading “Converting a PowerShell (PS1) Script to an EXE File”

Measuring Script or Command Execution Time in PowerShell

Sometimes you need to know how long it takes to execute a PowerShell script or a particular block of code. This allows you to predict how long it will take for the script to perform the required action, make changes to your system settings, or return a result. There are several ways to measure the execution time of a PowerShell command or script in Windows.

Continue reading “Measuring Script or Command Execution Time in PowerShell”

How to Completely Uninstall Microsoft SQL Server?

In this article, we’re going to look at a number of ways that you can uninstall a Microsoft SQL Server instance on a Windows computer. This article applies to all supported versions: Microsoft SQL Server 2019/2017/2014/2012.

Continue reading “How to Completely Uninstall Microsoft SQL Server?”

How to Check SQL Server Version?

In this article, we will look at several ways to find out the version and edition of the installed Microsoft SQL Server instance. For example, you are a DBA and you have been given the task of scheduling an upgrade on one of the SQL Server hosts. The first thought that comes to your mind is “How do I find out what version and edition of SQL Server is being used on a particular server?”.

Continue reading “How to Check SQL Server Version?”