Active Directory

How-to: Install Active Directory Domain Services (AD DS) with a New Forest | PowerShell

In a previous article How to: Install Active Directory Domain Services (AD DS) with a New Forest | Best Practices , we installed Active Directory Domain Services (AD DS) for a new forest, step by step, and to complete the topic, we will do the same installation, but using the PowerShell command line.

To install Active Directory Domain Services (AD DS) with a new forest using PowerShell and set the domain name as welcomeadmin.local, follow these step-by-step instructions:

Step 1: Prerequisites

local Administrator password must meet requirements

Verification of prerequisites for Domain Controller promotion will be failed. if The password of local Administrator account that will become the domain Administrator account not meet requirements. so you should change it Or run this commend1

Rename Server

Always run PowerShell with administrative privileges when making changes to network configurations.

Configure Time Zone

Verify Time Zone:

Configure TCP/IP

  • Uncheck IPv6 on TCP/IP settings in Windows Server, you typically go through the network adapter properties. Here’s how you can do it:

  • Set IP Address, Subnet Mask, and Gateway

OR

Replace “Ethernet0” with the appropriate network interface alias if it’s different on your system.
  • Set Primary and Secondary DNS Servers

Or

Verify TCP/IP Setting

  • To verify that the settings have been applied correctly, you can use PowerShell cmdlets to check the network configuration:

Step 2: Install the AD DS Role and Feature

  • Run the following PowerShell command to install the AD DS role:

Step 3: Promote the Server to a Domain Controller 2. Create New Forest:

  • Use the following PowerShell command to promote the server to a domain controller:

Or

There’s no a new domain or forest functional level for Windows Server 2019, 2022 so an acceptable values for this parameter are:

  • Windows Server 2003: “2” or “Win2003”
  • Windows Server 2008: “3” or “Win2008”
  • Windows Server 2008 R2: “4 or “Win2008R2”
  • Windows Server 2012: “5” or “Win2012”
  • Windows Server 2012 R2: “6” or “Win2012R2”
  • Windows Server 2016, 2019, 2022: “7” or “WinThreshold” 
  • After the installation completes, restart the server to apply the changes.

Verify Installation

To ensure that Active Directory Domain Services is installed correctly, you can perform the following to

Check AD DS Installation:

  • Open PowerShell as Administrator.
  • Run the following command to import the Active Directory module:
  • Run the following command to verify that the AD DS role is installed:

Verify Domain Creation:

  • On the server, open Server Manager.
  • Navigate to Tools > Active Directory Users and Computers.
  • In the Active Directory Users and Computers window, expand the “welcomeadmin.local” domain to verify its existence.

Check DNS Configuration:

  • Open PowerShell as Administrator.
  • Run the following command to check DNS settings:

Test Domain Controller Functionality

  • Join a test machine to the “welcomeadmin.local” domain to ensure that domain controller functionality is operational.

Congratulations! You have successfully installed Active Directory Domain Services with a new forest named “welcomeadmin.local” using PowerShell. Perform the verification steps to ensure that everything is configured correctly.

Helpful Resources:

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
TOC ......