How to create an Active Directory user using PowerShell

How to create an Active Directory user using PowerShell

 

In this blog post, I’ll show you How to create an Active Directory user using PowerShell cmdlet on a Windows Server 2016 Domain Controller.

In the last few years, Microsoft has been developing the Active Directory PowerShell module to do everything using the Shell without needing to use the GUI management console.

Using the Shell Is easy and there Is no need to Install additional components or tools to get it working as It was already Installed during the Active Directory Deployment process.

The prerequisites are:

  1. Administrative Permission to create users and other Active Directory Objects
  2. Run the cmdlets from a machine or a Domain Controller with the Tools Installed.

If you haven’t gotten the console Installed, you can Install the AD Tools and PowerShell Module on a management workstation or Server using the cmdlets below:

Add-WindowsFeature AD-Domain-Services, RSAT-AD-AdminCenter,RSAT-ADDS-Tools

The first step in the process Is to open the Active Directory Module For Windows PowerShell from the Administrative Tools.

You could also open a regular PowerShell Console and Import the module using:

Import-Module activedirectory

In the example below, I’ll create a new Active Directory Domain User with an email address and Title.

New-ADUser -Name "David Ron" -EmailAddress "[email protected]" -Title "Administrator"
How to create an Active Directory user using PowerShell
How to create an Active Directory user using PowerShell

To view all users, use the cmdlet below:

Get-ADUser -Filter * |ft
How to create an Active Directory user using PowerShell
How to create an Active Directory user using PowerShell

Since the New-ADUser cmdlet Is very powerful you might want to view the cmdlet options using:

Get-help New-ADUser

Search








Bitnami