Adding user accounts in Active Directory of Windows Server 2012

Active Directory users and computersOne of the first jobs after installing Active Directory, is creating user accounts, in order for the users to be authenticated in Active Directory. The authenticated user; therefore, can access the network resources. In this way an unauthorized user does not have access to the network without administrator’s permission. 

As usual, my well known two ways:

GUI:

  1. Hit Windows Key + R buttons, type dsa.msc, and press OK
  2. Active Directory Users and Computers window opens. Remember you can open it via Server Manager too
  3. The easiest way, is to right click Users object on the left bottom side, click on New, then User
  4. Fill the First and Last names as you desire. Mine will be User1. User logon name is User1 too. Click Next
  5. Choose a strong password, and leave the default settings intact. Then Next and Finish
  6. Now I want to make this account, a member of administrators. So on the working window, click on Users, and right click User1 on the left side. Then click on Add to a group…
  7. On Select Groups window, type Domain Admins; Enterprise Admins. Then click on OK twice

As a result, a user, by the name of User1 is created, who is the administrator of both domain and forest.

 

PowerShell:

  1. Open PowerShell console
  2. Type and hit enter this command:

New-ADUser -SamAccountName User1 -AccountPassword (read-host "Set user password" -assecurestring) -name "User1" -enabled $true -PasswordNeverExpires $false -ChangePasswordAtLogon $true
Add-ADPrincipalGroupMembership -Identity "CN=User1,CN=Users,DC=cyrusbesharat,DC=local" -MemberOf "CN=Enterprise Admins,CN=Users,DC=cyrusbesharat,DC=local","CN=Domain Admins,CN=Users,DC=cyrusbesharat,DC=local"

About these ads

2 Responses to Adding user accounts in Active Directory of Windows Server 2012

  1. Pingback: Managing Active Directory accounts using PowerShell | Cyrus Besharat

  2. Pingback: Powershell Tips & Tricks | Rezwan's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: