Installing and Configuring Windows Server Core

Starting to get a lot of servers in my HomeLab which are consuming a lot of resources. Decided to start reducing core services footprint by running Windows Core where I can.

The benefits of running Windows Server Core include:

  1. low resource usage
  2. and greatly reduced attack surface.

Here are the steps that I followed to build my Windows Server Core Domain Controller.

The following settings were used for this build:

 Value
PlatformHyper-V
vCPU1
Memory2048MB
Harddrive160GB
Harddrive 240GB
Network1x NIC

Mount the ISO and install as per normal.

Enter password for the local administrator account to log in.

To configure a dedicated disk to store the AD objects, we need to run Diskpart.

In the command prompt, enter the following commands:

Diskpart

List disk

Create Partition Primary

Select Partition 1

Active

Format FS=NTFS label=App

Assign letter=e

Exit

Now that you are back in Command Prompt, enter the following commands:

sconfig

Now select the relevant number to change the settings.
For this example, i will change the computer name.

2

Enter the new name for the computer.
Restart when prompted.

Log into the server, and run sconfig again.
Time to change the network settings.

8

1

1

S

Enter the IPv4 details

4

Now to install Server Roles.

Type powershell.exe to convert to Windows Powershell.

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

Install-ADDSForest -Domainname <NameofForest> -DatabasePath “E:\AD\DB” -LogPath “E:\AD\Log” -SysvolPath “E:\AD\SYSVOL”

Enter the safemode administrator password

Select Yes to All

You have now successfully created a Windows Core Domain Controller.

To add another domain controller to the domain, build to the same specs as the above server.

Run the following commands:

                Type the word Powershell to run powershell.

                Install-WindowsFeature AD-Domain Services -IncludeManagementTools

Install-ADDSForest -Domainname <NameofForest> -DatabasePath “E:\AD\DB” -LogPath “E:\AD\Log” -SysvolPath “E:\AD\SYSVOL”

Enter the Admin password.

Reboot

Make sure you run DCDiag and confirm that there are no issues.

MySQL Windows Installation Guide

MySQL Software can be downloaded from here. You will need to need to create a free Oracle account to access the software.

  1. Run the executable.

mysqlinstall1

  1. Tick ‘I accept the license terms’

mysqlinstall2

  1. Select ‘No, I either don’t have My Oracle Support or don’t want to use it now’, and tick the Don’t Ask Again box.

mysqlinstall3

  1. Select Custom. This allows you to specify whether to install 32x or 64x.

mysqlinstall4

 

  1. Install the following roles:
    1. MySQL x64
    2. MySQL Workbench – x64
    3. MySQL Notifier – Any
    4. Connector/ODBC – x64
    5. Connector/C++ – x64
    6. Connector/C – 64

Install any other additional Connectors you may need.

mysqlinstall5

 

 

  1. No need to do anything on this next step:

mysqlinstall6

  1. Select Yes and will install the failed requirements pre-reqs.

mysqlinstall7

  1. Select ‘Execute’

mysqlinstall8

  1. Will install the MySQL products selected.

mysqlinstall9

 

  1. There is a known issue that the ODBC Connector fails on installation. This is a known issue and the workaround is to run a separate Connector/OOBC installer post-install.

mysqlinstall10

  1. Select Next for Product Configuration.

mysqlinstall11

  1. Select the Config Type.
    1. If you are using this as a Development machine, then select Development Machine;
    2. Else, select Server Machine if installed on server with the web application;
    3. Or the preferred choice, MySQL running on a Dedicated Machine.

mysqlinstall12

 

  1. Select what TCP/IP port number. I would suggest not using the default port.
    Tick ‘Show Advanced Options’.

mysqlinstall13

  1. Add a password for the current Root Account, and create a MySQL user with DB Admin privileges.

mysqlinstall14

  1. Change the Windows Service name from MySQL56 to MySQL, leave the rest as is.

mysqlinstall15

  1. Under advanced options, you can change the type of logging.

mysqlinstall16

  1. Then select Execute once ready.

mysqlinstall17

  1. Select Finish once all green ticks.

mysqlinstall18

 

Uninstallation of MySQL

To uninstall MySQL from a Windows based machine, follow the below steps:

  1. Run a Command Prompt as an Administrator and running the following commands:
    1. Net stop MySQL
    2. Sc delete MySQL
  2. Under Control Panel à Programs à Program and Features, right click on MySQL Server 5.6 and select uninstall.
  3. Uninstall any other additional features from MySQL through Program and Features.
  4. Restart the machine.

How To – Build A Domain Controller

A critical function for any IT infrastructure is a domain. A domain is a logical group of objects, such as computers, users, user groups, administrators and service accounts. It is the backbone for any IT infrastructure.

  1. Once you have a base image of Windows Server installed and ready to go, you can install the necessary roles and features for Active Directory.
  2. On the Server Manager main screen, click on Add Roles and Features then select Next.
    domaincontroller1
  3. A dialog box will open, on the first screen select Next.
    domaincontroller2
  4. On Installation Type screen, leave the default of Role-Based or Feature-Based Installation and select Next.
    domaincontroller3

  5. On the next screen,the server should be listed in the Server Pool. Highlight the server and select Next.
    domaincontroller4

  6. Tick the box next to Active Directory Domain Services role. Press Next.
    domaincontroller5
  7. Leave the Features page as is, and select Next.
    domaincontroller6

  8. Select Next.
    domaincontroller7
  9. Confirm the options and select Install.
    domaincontroller8
  10. If successfully installed, you will see the below page. Select the hyperlink that says Promote this server to a domain controller.
    domaincontroller9
  11. A new dialog box will appear. Select Add a new forest option, and enter the domain name. For example test.testlab.
    domaincontroller10
  12. Select the functional level. A functional level means that only servers that have this operating system or later can be a Domain Controller.
    Enter a strong password for the Directory Services Restore Mode. Make sure to add the password to your organisations password safe.
    domaincontroller11
  13. Leave the DNS Options as default and select Next.
    domaincontroller12
  14. Windows will automatically work out the NetBIOS domain name for you. For example test.testlab would be a NetBIOS name of test.
    domaincontroller13
  15. Generally i leave the location for the database, logfiles and SYSVOL as default.
    domaincontroller14
  16. Review the options and select Next when satisfied.
    domaincontroller15
  17. Check that there are no errors in the results and then select Install.
    domaincontroller16
  18. Once installed, the server will restart itself automatically.
    domaincontroller17
  19. And when you next log in you will see that the server is already connected to the domain ready for the Administrator to log in.
    domaincontroller18

And there you go, a domain and a domain controller ready to go.