Create user account in active directory using PowerShell

Following commands are used to manage user accounts via PowerShell.

PowerShell Cmdlet Description
New-ADUser To create user account
Set-ADUser Modifies properties of user accounts
Remove-ADUser Deletes user accounts
ADAccountPassword Resets the password of a user account
Set-ADAccountExpiration Modifies the expiration date of user account
Unlock-ADAccount Unlocks a user account after it has become locked after too many incorrect login attempts

There are number of ways to create user account using PowerShell. In this article, we are creating account using New-ADUser cmdlet.

New-ADUser -Name “user1” -UserPrincipalName user1@k2schools.com

New-ADUser Syntax:

New-ADUser [-Name] [-AccountExpirationDate ] [-AccountNotDelegated ] [-AccountPassword ] [-AllowReversiblePasswordEncryption ] [-AuthType { | }] [-CannotChangePassword ] [-Certificates ] [-ChangePasswordAtLogon ] [-City ] [-Company ] [-Country ] [-Credential ] [-Department ] [-Description ] [-DisplayName ] [-Division ] [-EmailAddress ] [-EmployeeID ] [-EmployeeNumber ] [-Enabled ] [-Fax ] [-GivenName ] [-HomeDirectory ] [-HomeDrive ] [-HomePage ] [-HomePhone ] [-Initials ] [-Instance ] [-LogonWorkstations ] [-Manager ] [-MobilePhone ] [-Office ] [-OfficePhone ] [-Organization ] [-OtherAttributes ] [-OtherName ] [-PassThru ] [-PasswordNeverExpires ] [-PasswordNotRequired ] [-Path ] [-POBox ] [-PostalCode ] [-ProfilePath ] [-SamAccountName ] [-ScriptPath ] [-Server ] [-ServicePrincipalNames ] [-SmartcardLogonRequired ] [-State ] [-StreetAddress ] [-Surname ] [-Title ] [-TrustedForDelegation ] [-Type ] [-UserPrincipalName ] [-Confirm] [-WhatIf] []

If we go with above example,

Create a User Account in Active Directory using GUI method

Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools
%d bloggers like this: