# Creating Domain Controller - DC02

## General machine info

* Machine Name: `DC02`
* IP Adress: `10.0.0.3`
* Subnetmask: `255.255.255.0`
* Gateway: `10.0.0.1`
* DNS: `10.0.0.2`
* Role: Domain Services, DHCP, DNS
* Domain: `amsterdam.bank.local`

## Installation after sysprep

1. Startup the machine.
2. When asked if you copied the Virtual Machine, select "I Copied It".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-d15be660733010b1d5bdc6ac8929e009751bfd08%2Fafbeelding%20(103)%20(2)%20(2).png?alt=media" alt=""></div>

3\. Choose the correct settings for your lab, in our example we choose for the region "Netherlands", for app language we choose "English (United States)" and for keyboard layout "United States-International"

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-db0b1207b88c576821e8901fc34b1fb46b95a98a%2Fafbeelding%20(1)%20(2).png?alt=media" alt=""></div>

4\. Accept the 'License terms'.

5\. When asked to "Customize Settings" and set a password for the `Administrator` user, set the same password as before. Which was `Welcome01!`.

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-e353c2ca183ba1cadd3e25455c959bcab3edf6d5%2Fafbeelding.png?alt=media" alt=""></div>

6\. Press CTRL + ALT + DEL and login with the user and password we just set.

## Renaming and setting a static IP

1\. Open File Explorer --> right click "This PC" --> Properties.

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-878750701574a515e496fadbe1256faf6785c632%2Fafbeelding%20(29)%20(2)%20(2).png?alt=media" alt=""></div>

2\. Click on "Rename this PC".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-d52bb3809ce6455860a6cf7385a0e299724b6afe%2Fafbeelding.png?alt=media" alt=""></div>

3\. Fill in `DC02` and click "Next".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-b40221e425d2df2f13688ac3c91e45b154fee9d2%2Fafbeelding.png?alt=media" alt=""></div>

4\. When asked to restart, click on "Restart Now".

5\. Login again and rightclick in the Taskbar on the Networking Icon and select "Open Network & Internet Settings".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-c600b64347c6bbe316b5e4d6fabf5dd8faad79a3%2Fafbeelding.png?alt=media" alt=""></div>

6\. Click on "Change adapter options".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-987d24fef460654159e00bb83e3534438cadd107%2Fafbeelding%20(20).png?alt=media" alt=""></div>

7\. Right click the Ethernet adapter and select "Properties".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-7d67253a3c9f09d9ad3cbdd3cd02413ce2dd9a56%2Fafbeelding.png?alt=media" alt=""></div>

8\. Select "Internet Protocol Version 4 (TCP/IPv4) and click "Properties".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-0ca346d777b65ca375627d6c250f7e3fa0dfbc9d%2Fafbeelding.png?alt=media" alt=""></div>

9\. Copy the following settings:

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-2a85ed5158379468e10b994afe90c58d3cd23cfd%2Fafbeelding.png?alt=media" alt=""></div>

10\. Click on "OK" and close all the Windows.

## Creating Child Domain

### Installing Domain Services

1\. Click on start and open the "Server Manager".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-d24564630f70497fba35b7d1a7c867dca7be3db1%2Fimage.png?alt=media" alt=""></div>

2\. On the right top click on "Manage" and "Add Roles and Features".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-8b4c50fab8563bed5db78c47f290d256b40e6f66%2Fafbeelding.png?alt=media" alt=""></div>

3\. Check the "Skip this page by default" box and click "Next" three times (For the steps "Before You Begin", "Installation Type" and "Server Selection".

4\. At the step "Server Roles" select "Active Directory Domain Services".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-031a92373fc86b3497aaedf7a2a0c84f5f32b0cf%2Fafbeelding.png?alt=media" alt=""></div>

5\. After we have selected "Active Directory Domain Services" a new window will pop-up. Within this window we click on "Add Features".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-135915c3c2bd3334789e52e3c4f29e78fbc8c195%2Fafbeelding.png?alt=media" alt=""></div>

6\. After "Active Directory Domain Services" is selected we click on "Next". We also click "Next" at the "Features" and "AD DS" steps.

7\. At the "Confirmation" step click "Install". This can take some minutes.

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-7fcaf057403592aed790535c2f27f12930cbf2f6%2Fafbeelding.png?alt=media" alt=""></div>

8\. When the installation finishes close the window.

### Promoting to Child Domain Controller

1\. In the server manager click on the flag and click on "Promote this server to a domain controller"

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-7a86ce4cd50ecbe8842a6c1bb18811f977406975%2Fafbeelding.png?alt=media" alt=""></div>

2\. Select "Add a new domain to an existing forest". After this we choose the domain type "Child Domain". In this example our domain is called 'bank.local', so we fill this in at parent domain name. Our new domain name is going to be "amsterdam.bank.local", so fill in "amsterdam". At the last step we fill in the credentials of our parent domain. Click on "Next"

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-b28329e072225551119ba33f5758696ae3d8bf32%2Fafbeelding.png?alt=media" alt=""></div>

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-ba09bca3b70d6f35fe5cafb51c4bbebc517a00f4%2Fafbeelding.png?alt=media" alt="The &#x22;Change...&#x22; button window"></div>

3\. At the step "Domain Controller Options" set a DSRM Password. For this lab we will choose `AmsterdamBankRecoveryKey2022` as password.

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-43e9b65bc28695c55c87435fd596660b1ff33db9%2Fafbeelding.png?alt=media" alt=""></div>

4\. For the steps "DNS Options", "Additional Options", "Paths" and "Review Options" click Next.

5\. At the step "Prerequisites Check" click "Install".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-aae63f620e54bf7ac9975246e8a2096b5d36f037%2Fafbeelding.png?alt=media" alt=""></div>

With the help of PowerShell we can confirm that our child domain is created and that we have a trust to `DC01` (`bank.local`).

`Get-ADDomain`

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-fa25fa186ddf09312391e0028dbf49a77a0a8648%2Fimage.png?alt=media" alt=""></div>

`Get-ADTrust -Identity "bank.local"`

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-09c76e716f713b40aaafbbbbfb7f04fc54bcb1a0%2Fafbeelding.png?alt=media" alt="Get-ADTrust -identity &#x22;bank.local&#x22; - from DC02"></div>

### Creating extra Domain Admins

### Creating a user

1. Open the "Server Manager", click on "Tools" and then "Active Directory Users and Computers".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-d421b127f17eede6c032178891ab7554b051002e%2Fimage.png?alt=media" alt=""></div>

2\. Extend the directories and click on the folder "Users". All the default users and groups are shown in this folder.

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-d00fe8401f257ffd47af6eed02047ea26175d5f9%2Fimage.png?alt=media" alt=""></div>

3\. Right click the "Users" directory, go to "New" and click "User"

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-d9cf269296a8cb3cb8708a6d7fdcac23a893e6fe%2Fimage.png?alt=media" alt=""></div>

4\. Fill in the following information and click on "Next".

* First name: `Amsterdam`
* Last name: `admin`
* User logon name: `admin_amsterdam`

5\. For this user we will set a password we can remember `TheBestSecureBank2022`. Make sure you save it somewhere, like in a password manager. And uncheck the box "user must change password at next logon"

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-2fd98b232cfbca951bdfc79f6544bb92fcac5ad6%2Fimage.png?alt=media" alt=""></div>

6\. Click "Next" and "Finish"

### Adding the user to the group

1. Right click the user and click on "Add to a group..."

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-7680c5941bcf094b9be84482fde327cc20e29534%2Fimage.png?alt=media" alt=""></div>

2\. Add the user to the "Domain Admins" group by typing the name into the textbox and click on "OK

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-551e066d5838b4d63002caff1193e3ad62d0ada8%2Fimage.png?alt=media" alt=""></div>

3\. With the following simple PowerShell command we can check if `Amsterdam admin` is part of the `Domain Admins` group.

`Get-ADGroupMember "Domain Admins"`

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-47c08485adf9a779a896ed978b773b54a6c16ded%2Fimage.png?alt=media" alt=""></div>

## Installing and configuring the DHCP service

### Installing DHCP

Since we disabled DHCP in our VMWare, we need a DHCP server to lease IP-adresses to our machines which doesn't have a static IP, such as Workstations.

1. Click on start and open the "Server Manager".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-d24564630f70497fba35b7d1a7c867dca7be3db1%2Fimage.png?alt=media" alt=""></div>

2\. On the right top click on "Manage" and "Add Roles and Features".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-8b4c50fab8563bed5db78c47f290d256b40e6f66%2Fafbeelding%20(81).png?alt=media" alt=""></div>

3\. Click "Next" two times (For the steps"Installation Type" and "Server Selection".

4\. At the step "Server Roles" select "DHCP Server", click "Add Features" and "Next" three times.

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-a0554cd69a98aeb93dd5a9301a8f6cb471ce18ba%2Fimage.png?alt=media" alt=""></div>

5\. At the step "Confirmation" click "Install". Once the installation finishes click close.

6\. In the server manager click on the flag and click on "Complete DHCP configuration"

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-cefe7c2b7d839cfa490e2279e2f633cce156acc2%2Fimage.png?alt=media" alt=""></div>

7\. Click "Next" and then select "User alternate credentials" and fill in the credentials for `admin_bank`.

Username: `bank\admin_bank`\
Password: `jr8Q3o97@s37AF`

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-a24c75d7c20a5ace6631318d678b370404d157f0%2Fimage.png?alt=media" alt=""></div>

8\. Click on "Commit" and "close".

### Configuring DHCP

1. Click on "Tools" in the "Server Manager" and select "DHCP".

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-1483bd57cf133b08e0746d5c5171c2d5a23a1999%2Fimage.png?alt=media" alt=""></div>

2\. Unfold the directories, right click on "IPv4" and select "New Scope"

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-4d4a75873caec6ce6ac3f970c24408544cac5aca%2Fimage.png?alt=media" alt=""></div>

3\. Click "Next", fill in the name "DHCP Clients" and click "Next".

4\. At the step "IP Adress Range" fill in the following:

* Start IP Adress: `10.0.0.128`
* End IP Adress: `10.0.0.250`
* Length: `24`
* Subnet mask: `255.255.255.0`

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-c91bdc7a1a78bb33bbbcfb02ccc58155c3b066c7%2Fimage.png?alt=media" alt=""></div>

5\. At the step "Add Exclusion and Delay" and "Lease Duration" click "Next". We will leave this default.

6\. At the step "Configure DHCP Options" make sure "Yes" is selected and click "Next"

7\. Fill in `10.0.0.1` for the default gateway and click on "Add", it should be in the list and then click on "Next"

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-2e728e1e11eb5736a20786a4ae5cc37782320c6a%2Fimage.png?alt=media" alt=""></div>

8\. At the step "Domain Name and DNS Server" make sure `10.0.0.2` and `10.0.0.3` are listed as DNS servers.

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-4f8dc20eabd2e1fd74d76ba8616a08cf5ca9f8d5%2Fimage.png?alt=media" alt=""></div>

9\. At the step "WINS Servers" and "Activate Scope" click "Next".

10\. Click "Finish".

11\. We should now see a Scope for IPV4.

<div align="left"><img src="https://1033393870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPqGbN7FCY7Xh4OkOtvin%2Fuploads%2Fgit-blob-4fbff92ce403dbb453370f1151ff575b7598230b%2Fimage.png?alt=media" alt=""></div>
