Fixed, Dynamically Expanding, and Differencing Disks in Hyper-V

There are three types of virtual hard disks in Hyper-V. Those three types are: Fixed size Dynamically expanding Differencing I will explain each type with pros and cons in the article below. Fixed size Disk When you create a fixed-size virtual hard disk, space is reserved beforehand. Suppose you created a VHDX of 200 GB, ... Read more

Error when Executing a PowerShell Script for the First Time

When you are executing a PowerShell script for the first time you may encounter the following error: .... cannot be loaded because running scripts is disabled on this system. Why did this happen: PowerShell Execution Policies PowerShell has four execution policies for executing the script. Those four policies are described below: Restricted This is a default policy. ... Read more

How to Fix WinRm Firewall Exception Rule When Enabling PS Remoting

When you are enabling PowerShell remoting using the command Enable-PSRemoting, you may get the following error because your system is connected to the network trough a Wi-Fi connection. PS C:\WINDOWS\system32> winrm quickconfig The following changes must be made: Start the WinRM service. Set the WinRM service type to delayed auto start. Make these changes [y/n]? y ... Read more

How to Set Up an Active Directory on Windows Server 2016 Using PowerShell

In this tutorial, I will explain how to install an active directory on Windows Core Server 2016 using a few PowerShell commands. If you have already configured an AD Domain Service before, you may be aware that there are the following two high-level steps: Installing Active Domain itself. Promoting the server as domain controller. Install ... Read more

How to Check if a User or Group Exists in AD using PowerShell

If you want to check the existence of any user or group in Windows Active Directory, use the following PowerShell script. PowerShell: Check if AD User or Group Exists Step 1. Open PowerShell with elevated privileges. Step 2. Execute the following script: $userobj = Get-ADUser -LDAPFilter "(SAMAccountName=$username)" $vlanobj = Get-ADGroup -LDAPFilter "(SAMAccountName=$vlangroupname)" if ($userobj -eq ... Read more

How to Prevent Users from Shutting Down the Domain Joined Client Computers

Domain users are by default allowed to shutdown, restart, or put the domain-joined client computers to sleep. However, you can use a group policy to prevent them from shutting down or restarting the client computers. Following are step by step instructions written for this purpose. Prevent Users from Shutting Down their Computer Step 1. Open Group ... Read more

How to Hide Specific OU in Active Directory Users and Computers

When you open an active directory users and computers console, you will see some of the following containers or OUs. These are the available OUs or container types: Builtin Computers Domain Controllers ForeignSecurityPrincipals Managed Service Accounts Users Show all OU in Active Directory Console But these are not the only containers or organizational units in ... Read more

How to Remove Active Directory Domain Services Role from Windows Server using PowerShell

ADDS roles can be removed by using the GUI and Powershell. Powershell is a fast and easy method that requires only a single command. Remove ADDS Role with PowerShell Step 1: Open PowerShell. Step 2: Type in the following command and then press enter: Uninstall-ADDSDomainController -DemoteOperationMasterRole -RemoveApplicationPartition Step 3: Provide the local administrator password and press ... Read more