How to Migrate Print Services from Server 2012 to Server 2016

These instructions describe how to migrate print services from Windows Server 2012 R2 to Windows Server 2016. Windows Server 2016 has built-in migration wizard. Install Print Services on Server 2016 Step 1: Open the server manager. Click on the Add Roles and Features wizard. Step 2: Click on Next. Step 3: Choose Role-based or feature-based installation ... Read more

How to Clean Up Active Directory Domain in Server 2012 R2

When a domain controller server is crashed and it still exists in an active directory setup, then it can make trouble later when you are promoting new machines to the domain controller. This guide is written to help you clean up your active directory setup. 1. At the command prompt, type in the following commands: C:\WINDOWS>ntdsutil ntdsutil: metadata ... Read more

samAccountName Vs userPrincipalName

In this article, I am going to explain the difference between a samAccountName and a userPrincipalName which are often used in an Active Directory context. samAccountName It was used with an earlier version of windows (pre-windows 2000). User login name is in the format of DomainName\testUser. It should be less than 20 characters. It should be ... Read more

How to Prompt a User for Input using PowerShell

You can use the read-host command-let to get an input from a user during program execution. PowerShell Input Example Here is a related example, the program gets two numbers in string format and converts them into integers and then sums up those numbers and finally displays the result. The -prompt parameter is used to display a ... Read more

How to Read a Text File Using PowerShell

You can read a text file and display its content using get-content cmdlet in PowerShell. Read textfile example Execute the following command on PowerShell with elevated privileges. Get-Content c:\scripts\test.txt This command will display the contents of the file test.txt which is located in c:\scripts\

How to Generate Random Numbers Using PowerShell

When you have to generate random passwords for users, you can execute the get-random command let on PowerShell to create it. Generate Random Number get-random -maximum 2000 -minimum 100 This command, when executed on PowerShell, creates a number between 1999 (not 2000 and always set one number higher in maximum) and 100.

How to Configure DHCP with PowerShell

PowerShell commands are an easy way to save a lot of time as system administrator. In this article, I'll show you how to configure DHCP from PowerShell. I have following information including scope, and router gateway IP. DHCP DNSServerIP="192.168.1.10" DHCPServerIP="192.168.1.10" StartRange="192.168.1.150" EndRange="192.168.1.200" Subnet="255.255.255.0" Router="192.168.1.1" Following is the configuration break down: Installing DHCP Adding DHCP scope ... Read more