• Joining a Windows Host to a Domain

    Joining a Windows Host to a Domain

    This post contains a demo of joining a Windows Server onto a test Domain, which I created in my previous post (Installing Active Directory on Windows Server 2016).

    Joining a Windows Computer to Active Directory Domain Services is required in 99% of Corporate environments, and is usually a Systems Administrator task to configure at the Domain Controller side. Adding a computer to AD allows your computer to be administered via Group Policies that can be applied to all remote computers globally within your company. This helps companies lock down computers and roll out new software or updates.

    There are 2 parts to this one:
    > Creating a New Domain User Account
    > Joining a Windows Server to a Domain

    Creating a New Domain User Account

    I’m creating a new user account for me to carry out all changes required to set up my lab. It’ll be a new OU in AD, create a new user account and then add it to the Domain Admin group.

    1. Right-click the Domain Name within Active Directory Users and Computers, select New and Organisational Unit:

    Active Directory New Organisational Unit

    2. Enter the new OU name – I’m going to pretend I’m in the IT Department:

    Active Directory New Organisational Unit Name

    3. Within the IT OU, right-click and select New-User:

    Active Directory New User

    4. Enter new user details:

    Active Directory New User Details

    5. Enter password stuff:

    Active Directory New User Password

    6. Finish:

    Active Directory New User Finish

    7. Right-click the new user and select Add to a group:

    Active Directory Add User to Group

    8. Enter king group, Domain Admins:

    Active Directory Add User to Domain Admins

    Joining a Windows Server to a Domain

    1. First, I have to get onto the same private IP range as the DC:

    IPv4 Config
    Ping Test to Active Directory

    2. Within Server Manager, click the Computer name link:

    Windows Server Manager Computer Name

    3. Click Change:

    Windows Systems Properties

    4. Amend the hostname and enter the Domain name:

    Computer Name Change and Join Domain

    5. Enter credentials for an account that can join the domain (the account created above within this post would also work):

    Domain Join Elevation Prompt

    6. When the server next boots up a domain user account can log in:

    Windows Server Login to New Domain

    And that should be us!

  • Installing Active Directory on Windows Server 2016

    Installing Active Directory on Windows Server 2016

    This post contains a demo installation of Active Directory Domain Services on Windows Server 2016. It follows a previous post for a series of test lab configuration posts.

    Microsoft docs on installing AD on Windows Server can be found here: Install Active Directory Domain Services

    Configuring a Windows Server 2016 on a local Hyper-V can be done by following my previous post: Installing Windows Server 2016 with Hyper-V

    The following steps will get your test Windows Server environment set up to run Active Directory:
    # Create a Hyper-V Private Network.
    # Configure Windows TCP/IP Settings.
    # Rename the Windows Server Host.
    # Install Active Directory.
    # Promote the Server to a Domain Controller.
    Once the above has been achieved, you can create a new VM in Hyper-V (or other Hypervisor) and join your Domain, as I’ve done for some tests.

    Create a Hyper-V Private Network

    1. Right-click the Hyper-V host and select Virtual Switch Manager.

    Hyper V Virtual Switch Manager

    2. Select Private and Create Virtual Switch.

    Hyper-V VSwitch Manager New Private Switch

    3. Enter a name for the network and click okay.

    HyperV vSwitch Manager

    4. Right-click the VM in Hyper-V and click Settings.

    HyperV VM Settings

    5. Add a new Network Adapter.

    HyperV Add New Network Adapter

    6. Select Private vSwitch as named above and click OK.

    HyperV Add New Network Adapter

    Configure Windows TCP/IP Settings

    1. When the above has been set-up, Windows Server will show network settings as Identifying…

    Windows Server Identifying Network

    2. Right-click the network icon and click Open Network and Sharing Center.

    Windows Network and Sharing Center

    3. Click the highlighted active Ethernet connection.

    Windows Server Network and Sharing Center

    4. Open Properties.

    Windows Ethernet Adapter

    5. Open Internet Protocol Version 4 (TCP/IPv4) Properties.

    Ethernet Adapter IPv4 Properties

    6. Enter IP and subnet addresses.

    Windows Ethernet Adapter IPv4 Address

    Rename the Windows Server Host

    1. Open Server Manager and click the highlighted Computer Name.

    Windows Server Manager Host Info

    2. Click Change…

    Windows System Properties

    3. Enter new Computer Name and click OK.

    Windows Server Computer Rename

    The host will require a reboot once done.

    Installing Active Directory

    1. Within Server Manager, click Manage > Add Roles and Features.

    Windows Server Manager Add Roles and Features

    2. Before you begin, read the before you begin.

    Server Manager Add Roles and Features

    3. Select Role or Feature-based installation.

    Server Manager Add Roles and Features Installation Type

    4. Select the destination server.  

    Server Manager Add Roles and Features Destination Server

    5. Tick the Active Directory Domain Services checkbox.

    Server Manager Add Roles

    6. The following will appear – click to add the additional tools.

    Server Manager Add Roles Active Directory

    7. No features are being added at this time – click to continue.

    Server Manager Add Features

    8. ADDS page is worth a read – nothing to change here.

    Server Manager AD DS

    9. Review and click to install.

    Server Manager Roles and Features Installation

    10. Leave it a few minutes and we’re then able to promote this server as a new Domain Controller.

    Server Manager Active Directory Installation

    Promote the Server to a Domain Controller

    1. Once done with the above, there won’t be a finish point within the wizard. Click the flag on Server Manager to Promote the server to a Domain Controller.

    Active Directory Promote to DC

    2. This is a new test environment, so I need to Add a new forest.

    Active Directory Domain Services Config Wizard

    3. A new Forest means Functional Levels can be the latest edition available, Windows Server 2016. This is also the place to enter an important password that is required if recovering a failing AD.

    Active Directory Domain Controller Options on Install

    4. The following error is listed within the known issues for installing and removing AD DS. It’s expected if create a new forest as I’m doing.

    Active Directory Domain DNS Options

    5. Enter a preferred NetBIOS name.

    Active Directory Configuration Additional Options

    6. Locations can stay as defaults of course.

    Active Directory Installation Paths

    7. Time for us to review wizard selections.

    Active Directory Installation Review

    8. As you’ll see in the image above, we can click to view the PowerShell script that is about to run with the wizard selections included.

    Active Directory Installation Script

    9. A prerequisites check will run as we hit next from above. 

    Active Directory Installation Prerequisites

    10. Click to install…

    Active Directory Installation Progress

    11. An automatic reboot will be initiated at the end.

    Windows Reboot

    12. When back up and running, we can log in to the new domain.

    Windows Server Domain Login

    13. And have a look at our Active Directory Users & Computers, just for the fun demo of course.

    dsa.msc
    Active Directory Users and Computers
  • How to Install Windows Server on Hyper V

    How to Install Windows Server on Hyper V

    This guide provides a step-by-step walkthrough for installing Windows Server on Hyper-V. By the end of this tutorial, you’ll have a fully operational Windows Server VM, ready for further configuration and testing.

    If you need to install the Hyper-V role on Windows first, refer to this guide – Microsoft Docs: Install Hyper V on Windows

    What This Guide Covers:
    1. Creating a new Hyper-V Virtual Machine
    2. Installing Windows Server (2016)

    Once you complete this setup, you can proceed with additional configurations, such as installing Active Directory (AD) on your new server.

    1. Creating a new Hyper-V Virtual Machine

    1. Right-click your Hyper-V Manager host machine, and select New > Virtual Machine…

    Hyper-V New Virtual Machine
    New Virtual Machine HyperV

    2. Enter the name of the new VM and the location on disk.

    Hyper-V VM Name and Location

    3. Select Generation of VM.

    Hyper-V Virtual Machine Generation

    4. Enter the memory allocation amount.

    Hyper-V Virtual Machine Memory Allocation

    5. Select a network connection (I’ll set this up later).

    Hyper-V Virtual Machine Network

    6. Enter the dynamic virtual hard disk limit, and for this tutorial, I’m leaving the vHD location as default (driven from the previous selection).

    Hyper-V Virtual Machine Hard Disk

    7. Select an Operating System ISO file.

    Hyper-V Virtual Machine ISO

    8. Review configuration and hit finish.

    Hyper-V New Virtual Machine Summary

    9. Power up the new VM!

    Hyper-V Virtual Machines
    Hyper-V Virtual Machine List

    2. Installing Windows Server (2016)

    1. Connect to the new VM (ensuring step 7 above was followed).

    Hyper-V VM without OS

    2. Hit any key.

    Hyper-V boot from CD

    3. After 30 seconds or so of loading, select your location.

    Windows Server 2016 Installation Language

    4. Click to start the Windows Server installation.

    Windows Server 2016 Installation

    5. GUI this time around, and Datacenter Edition for the test environment.

    Windows Server 2016 Datacenter Installation

    6. Accept the usual.

    Windows Server 2016 License Agreement

    7. Check advanced options.

    Windows Server 2016 Installation Type

    8. Install on the 50GB vHD.

    Windows Server 2016 Installation Location

    9. Hit next, and away it goes…

    Windows Server 2016 Install

    10. The installation will finish up and restart once it’s done. Before the Windows Server login screen is shown, the built-in administrator password needs to be set.

    Windows Server 2016 Admin Password

    11. Login with the above password.

    Windows Server 2016 Administrator Login

    12. Hurray, it’s Windows 2016 everybody!

    Windows Server 2016 Server Manager

    Now that your Windows Server VM on Hyper V is up and running, you can proceed with additional configurations, such as:
    Installing Active Directory (AD) for domain services. The post I’m linking is a direct follow-up of this with the HyperV focus.
    Configuring network settings and firewall rules. If you have Windows Firewall enabled, my blog tag as linked might be useful.
    Setting up roles and features based on your use case. I’m linking to my FCI feature blog tag which is the Windows feature I install as a Microsoft SQL DBA most commonly.

  • Resolving “Windows could not start the SQL Server”

    Resolving “Windows could not start the SQL Server”

    If you encounter the message “Windows could not start the SQL Server on 127.0.0.1”, it signifies a problem preventing the SQL Server service from starting properly. This error is broad and can stem from various causes.

    Windows could not start the SQL Server

    Diagnosing the Issue

    To uncover the root cause, we can check Windows Event Viewer:
    1. Open Event Viewer: Press Win + R, type eventvwr, and hit Enter.
    2. Navigate to Windows Logs > Application.
    3. Locate error entries related to SQL Server during the startup attempt.

    Windows Event Viewer Application Errors

    The Event Viewer will typically provide more specific details to guide your troubleshooting process. In this example, my SQL Server 2019 evaluation period has expired! When installing SQL Server for long-term use, consider selecting the Developer Edition to avoid such expiration issues while maintaining access to all features for development and testing purposes.

    Another common reason for this error message is when SQL Server Service Accounts encounter issues, such as incorrect passwords or account lockouts. Reviewing the account status in Active Directory and updating the credentials before restarting the SQL Services often resolves the issue.

    If you’ve encountered the “Windows could not start the SQL Server on 127.0.0.1” and it’s not due to reasons described in this post, please share your experience by adding comment below!

  • Resolving “Index was out of range” in SSMS

    Resolving “Index was out of range” in SSMS

    This post is here to help if you’ve encountered the following error while performing a task in SQL Server Management Studio (SSMS):

    Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index (mscorlib)

    Index Out of Range SQL Server Management Studio

    In my experience, I’ve seen this come up several times when trying to change the order of steps in a SQL Agent Job in SSMS.

    Resolving “Index was out of range” Issue

    To resolve this issue, update to the latest version of SSMS.

    Feel free to follow my link for installing the latest version of SSMS which includes a link to the Microsoft download and some useful SSMS tips from a DBA. Otherwise, the quick official link is here: Microsoft Docs: SSMS Download

    Full Error Message & Follow-Up

    This error might even happen for you even if using the latest version of SSMS. I’m not sure what the root cause is, but the first best troubleshooting step is to update SSMS as explained.

    Here’s the full error I got:

    I tried to change the SQL Agent job step here from step 3 to 1:

    SQL Agent Job Steps
    SQL Agent Job Step Order Change

    I got this error message when I hit the button above:

    Index Out of Range error SSMS
    Index out of range Full Error

    Searching for this error online often led me to a lot of unrelated information about .NET development. If updating SSMS resolved for you, or if you’ve done that and still having the issue, please feel free to add a comment below!