Adding a Secondary Active Directory Domain Controller on Windows Server 2016

After setting up an Active Directory (AD) on our Windows Server it is advisable to have another server to be a Secondary Active Directory Domain Controller to become the failover for Active Directory in case something happens to the first AD Server.

Below is a detailed tutorial on how to properly set up a Secondary Active Directory Domain Controller on Windows Server 2016.

Note

Primary refers to the first Windows Server that we setup Active Directory with.

Secondary refers to the the Second Windows Server we will set Active Directory. This is what we will setup here.

Here are the major steps that we need to do

Setup

Testing


Setup

Primary: Get the IP Address of the Primary Active Directory Domain Controller

Login to your Primary Active Directory Windows Server.

Right-click on the Window Icon on the bottom-left of the screen. Then click Command Prompt.

On the command prompt window type ipconfig then Enter.

Note the IPv4 Address. You will need this later on the Secondary Windows Server. Continue reading Adding a Secondary Active Directory Domain Controller on Windows Server 2016

Change Password for Active Directory Administrator on Windows Server 2016

The very first thing I do after installing Active Directory (AD) on Windows Server is to change the password of my AD Administrator. I do this because I use Amazon Web Services (AWS) EC2 as my servers and AWS automatically generates the password for my Windows Server.

The AD Administrator is a very powerful user for Active Directory as you can restrict or open capabilities to other users and computer, install/uninstall programs and can even shut down any member computer using the Admin user. That is why you should really keep your AD Administrator User password in a safe place.

Whatever the reason you have for wanting to change the password of your AD Administrator below is a step-by-step tutorial on how to change it.

Login to your Windows Server.

Click on the Window Icon on the bottom-left and click on Server Manager.

Click on Tools then Active Directory Users and Computers.

Click on the ‘>‘ sign beside your domain on the left sidebar. This will expand the tree. Continue reading Change Password for Active Directory Administrator on Windows Server 2016

Configure Active Directory on Windows Server 2016

Below are detailed instructions on how you can setup Active Directory on your Windows Server 2016.

Sections on installing Active Directory.

Note: You can only do the steps below if you are an Administrator of your Windows Server.

Change the Computer Name

This is an optional step, but I would highly encourage you to do this so that your computer name will not be like EC2AMAZ-3TVT1HF, but a more descriptive one.

In this case since I am going to use the computer that we will setup as an Active Directory Domain Contoller I shall name my Windows Server as DC01.

In fact, you will have a lot of problem if you rename your computer after installing Active Directory. So better do it now before continuing to the next step.

Follow the steps on my post to change the Computer Name of your Windows Server 2016.

For now check the System Information page of the Windows Server.

Note the Workgroup.

Install Active Directory Feature

Now that we have updated the Computer Name of our Windows Server we can now start installing Active Directory.

Click on the Window Icon on the bottom-left side of the screen. Click Server Manager from the Menu.

On the Server Manage Window click on Add roles and features. Continue reading Configure Active Directory on Windows Server 2016

Changing the Computer Name of Windows Server 2016

Every time I launch a Windows Server on AWS or Google Cloud it always provides a random Computer Name. As a good practice I always want my computers to be named descriptively.

In this case I would like to update my Windows Server 2016 Computer Name to DC01, which means Domain Controller 01, since I will be using this server for Active Directory.

Below is a step by step guide on how to rename my Windows Computers to a more descriptive name.

Renaming the Windows Computer

Right-click on the Window Icon on the lower-left of the screen. Then click on System.

On the System Information Window, under Computer name, domain, and workgroup settings click on Change settings.

Continue reading Changing the Computer Name of Windows Server 2016

Installing MySQLdb for Python 3 in Windows

My favorite Python connector for MySQL or MariaDB is MySQLdb, the problem with this connector is that it is complicated to install on Windows!

I am creating this article for those who want to install MySQLdb for Python 3 for Windows. Especially me, since each time I am doing a Python project that needs to connect to MariaDB or MySQL I always look on how to install MySQLdb.

If you are interested why I prefer MySQLdb compared to other MySQL connectors you may want to read the comparison of MySQL-connector and MySQLdb from Charles Nagy.

Problems with installing MySQLdb on Windows

You can actually install MySQLdb using pip. See pypi documentation here.

Unfortunately, the pypi documentation is already out of date with the latest release was on Jan 3, 2014. Continue reading Installing MySQLdb for Python 3 in Windows

Resizing Storage Volume for AWS EC2 Windows without Restarts/Downtime

Problem: You are running a critical Windows Server on AWS EC2 and the C: drive is almost full (storage volume) but it should zero downtime (No Restart, No Stop then Start). Is this possible on AWS EC2?

Yes, it is possible.

Check the instructions below.

Test Windows Server

AMI Microsoft Windows Server 2016 Base
Instance Type t2.micro
Storage 30 GiB – General Purpose SSD (gp2)

Storage Size

We are increasing the Storage size from 30 GiB to the target size of 50 GiB.

You can set any size that you want as long as it is bigger than the current size.

Resizing Storage

To resize the volume of the Windows Drive on AWS you can follow the steps below. Continue reading Resizing Storage Volume for AWS EC2 Windows without Restarts/Downtime

AWS Lambda Console: Accessing Environment Variables via Python

Editing configuration values inside the code is a high risk for error since there is a high chance that not only the values that you are changing you will change, you might even delete a letter or edit a line. In order to avoid this risk, you want your code to be able to accept configuration values at run time. This is extremely useful when developing codes on different environments like development, testing and production.

With AWS Lambda you can reuse your code on different environments using the Environment Variables.

Below is the way to use Environment Variables on AWS Lambda Console using Python 3.6.

Note: This is the same way to use Environment Variables on Python 2.7 and Python 3.7.

Environment Variables Setup

The Environment Variables section can be found under the Function Code section.

Environment Variables are Key/Value Pairs. The Key is what you will use on your Lambda Code, to access its Value. Continue reading AWS Lambda Console: Accessing Environment Variables via Python

Making an Off-Screen Window Appear in Windows 10

When opening a program in Windows, sometimes it would open itself in a position outside of the screen. Right-clicking the program on the taskbar does not work. Trying to move it to a new desktop is also futile. Using window key+arrow keys is also not making it appear. What to do then?

Below is a way to make the off-screen window appear again.

  1. Click the off-screen program icon on the Windows Taskbar to make it the active window.

    I selected Powerpoint as my active window (highlighted).

    Continue reading Making an Off-Screen Window Appear in Windows 10

Running Minikube in AWS EC2 (Ubuntu)

If you are studying Kubernetes and having a hard time running Minikube on an EC2 Instance, you are not alone. I had a hard time doing it when it was my first time.

Below are the steps (and some comments) that I took to help me run Minikube on my EC2 Instance.

Installation of Minikube on EC2 Ubuntu

1. Run a public EC2 Server with the following setup

AMI Ubuntu Server 18.04 LTS (HVM), SSD Volume Type
Instance Type t2.micro
Storage 8 GB (gp2)
Tags – Key: Name
– Value: Minikube
Security Group Name: Minikube Security Group
– SSH, 0.0.0.0/0
Later we will be editing this.
Key Pair Create your own keypair.
You will need this to SSH to your EC2 Instance

The above setup is within the AWS Free Tier so you could try Minikube on EC2 without spending money. But you can run Minikube on a bigger instance if you like.

2. SSH into your created EC2 Instance using your keypair.

3. Install kubectl

4. Install Docker

Minikube requires Docker. Continue reading Running Minikube in AWS EC2 (Ubuntu)

Showing “Open with Atom” when right clicking File or Folder in Windows 10

When right clicking on the File or Folder in Windows Explorer, the context menu will not show “Open with Atom” as an option. Because of this a user would need to open Atom Text Editor then Add Project Folder to see the Folder Tree on the side bar. Quite a lot of steps really.

Having a “Open with Atom” would be a time saving feature.

Context Menu for Folders

 

Context Menu for Files

The Context Menu is the menu that you can see every time you right-click a file or folder in Windows Explorer or Windows Desktop.


Is there a way to add “Open with Atom” on the context menu when you right click on a file or folder?

Yes, there is. Follow the instructions below. Continue reading Showing “Open with Atom” when right clicking File or Folder in Windows 10