Learn ESL
Image default
How toWindowsWindows Server

Manage and Configure Active Directory via PowerShell

In this article, I am going to show you Manage and Configure Active Directory with PowerShell on Server 2016? I know and you know the Method how to install it on Server with GUI, but what about the core Version of a Server? The primary reason behind this article is,

  1. PowerShell takes less time.
  2. Many Organizations are using the core Version instead of GUI.
  3. PowerShell knowledge is getting bigger and bigger, so it’s better for you to start learning by now.

In this article we will discuss:

  • Get to Know Help System.
  • Install Active Directory Domain Services.
  • Import the required Modules.
  • Configure Active Directory Domain Services.
  • Installing the First Domain Controller in the Forest.

Note: Never Memorize commands, try to learn them, here is a trick How?

When I get into PowerShell, I was so afraid and I was asking myself How am I going to Put these many commands in my mind? But then I watch Jason Helmick ‘s course on up and running with PowerShell in Lynda.com, He should me that, the key to remember all the commands of PowerShell is The Help system of PowerShell infect Jeffrey Snover founder of PowerShell also recommend this method. Here are the two basic Course of PowerShell You have to watch.

  • Getting started with PowerShell with Jeffery Snover and Jason Helmick at MVA.com
  • Up and Running with PowerShell with Jason Helmick at Lynda.com

Get to Know Help System

If you are on core Version of the Server First type PowerShell and Press Enter. And if you are not on Core Server then simply open PowerShell.

Since ADDS is a feature in Windows Server, let’s collect Help on How to install it on the server?

Type Get-Help Install-Windowsfeature

Manage and Configure Active Directory via PowerShell
Manage and Configure Active Directory via PowerShell

Take a look at the syntax, first you have to type Install-Windowsfeature then you have to type –Name, it means type the name of the feature which you want to install, then you have to type –restart, it means if it requires restarting the system then restart it. In order to learn complete Help System Visit Discovering Microsoft PowerShell commands article.

Note: You have noticed that –name in the syntax but the question is what is the feature name?

I know I want to install Active Directory Domain Services but I don’t know the module name, in order to know that type this Get-windowsfeature command and Press Enter. Then go ahead and find the Active Directory Domain Services Module Name.

Manage and Configure Active Directory via PowerShell
Get-Windows Feature

Install Active Directory Domain Services

Now that you have learned about the help system of PowerShell and How to get the name of the feature let’s get into installing it.

Type Install-windowsfeature –Name AD-Domain-Services -Restart -IncludeManagementTools command and Press Enter.

Manage and Configure Active Directory via PowerShell
start Installation

If everything goes well you should end up with this screen.

If it happened to come across an error, please let me know in the comment below and I will try my best to resolve the error.

Manage and Configure Active Directory via PowerShellManage and Configure Active Directory via PowerShell
Successful Installation

Import the required Modules

Now that the installation has been completed this article is not going to end up here. Now I am going to install some additional to make the server run smoother and also walk through the process of setting up a new forest to make active directory work.

The module which I am going to import is the ADDSDeployment Module. You can import that with Import-Module ADDSDeployment command.

I will not provide a screenshot because there is no visible feedback from this command. If the command completed successfully then you will be faced with a blank prompt. Again, if you receive any errors, let me know.

Configure ADDS

Now, you need to promote your server to a domain controller. There are several commands that you can use to do this. Here is a list of the commands by which you can figure out which one best for you.

Command Description
Add-ADDSReadOnlyDomainControllerAccount Install read-only domain controller
Install-ADDSDomain Install first domain controller in a child or tree domain
Install-ADDSDomainController Install additional domain controller in domain
Install-ADDSForest Install first domain controller in new forest
Test-ADDSDomainControllerInstallation Verify prerequisites to install additional domain controller in domain
Test-ADDSDomainControllerUninstallation Uninstall AD services from server
Test-ADDSDomainInstallation Verify prerequisites to install first domain controller in a child or tree domain
Test-ADDSForestInstallation Install first domain controller in new forest
Test-ADDSReadOnlyDomainControllAccountCreation Verify prerequisites to install read-only domain controller
Uninstall-ADDSDomainController Uninstall the domain controller from server

Installing the First Domain Controller in Forest

Since it is about configuring the ADDS, I need to create a new Forest. In order to do that Install-ADDSForest command.

When you do that PowerShell will ask you to insert the Domain Name. In that case, I have given Techroze.com.

After that PowerShell will ask to insert the Safe Mode Administration Password and then it will ask you to confirm the Password. After that PowerShell will ask you, the target Server will be configured as a Domain Controller and restarted when this operation is complete. DO you want to continue with the Operation?

Press Y on the keyboard and it will install the new forest.

Manage and Configure Active Directory via PowerShell
Install-ADDSForest

Note: The Active Directory will now setup. You may receive various warnings, dependent on whether you have static IPs or not. You can see the progress of the installation in the teal-colored status bar covering the top half of the screen in the screenshot below.

Manage and Configure Active Directory via PowerShell
Errors list

When the installation Completes it will restart your system.

Summary

  1. Type Get-Windowsfeature command to show the Names of the feature.
  2. Then Type Install-windowsfeature –Name AD-Domain-Services -Restart -IncludeManagementTools
  3. Then type Import-Module ADDSDeployment command.
  4. Then type Install-ADDSForest command.
  5. Then Follow the instruction according to PowerShell like Domain Name, Safe Mode Password, and others.
Manage and Configure Active Directory via PowerShell
Summary

That’s all, I hope this article helped you Manage and Configure Active Directory with PowerShell on Server 2016.If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Related posts

Fix Windows Shutdown Problems

Ilyas

Manage Group Membership Using Group Policy

Ilyas

How to Learn the English Language Through News Channels

Zainab Azimi

Leave a Comment