How to enable an Active Directory account using PowerShell
To enable an Active Directory account using PowerShell, the Enable-ADAccount cmdlet has to be used. This article explains how to enable an AD account using PowerShell and also using ADManager Plus, an integrated Active Directory, Office 365 and Exchange management and reporting tool. This article also shows the ease with which AD account can be enabled using ADManager Plus compared to PowerShell.
Steps to enable an AD account using PowerShell.
- Ensure you have the necessary permissions to perform this action, and also to execute PowerShell scripts.
- Get the value for necessary attributes like the the sAMAccountName, the distinguished name (DN), GUID, or SID. of the account to be enabled.
- Create the script using the Enable-ADAccount cmdlet, and execute it in the PowerShell window.
A sample PowerShell script to enable an AD account
Click to copy entire script
Enable-ADAccount -Identity "John Smith"
This script will enable the account with the sAMAccountName John Smith.
ADManager Plus offers purpose-built features for every type of AD object. So, for each object type, it offers an enable option. For example, to enable a user account,
- Select the Enable/Disable Users feature, located in User Management.
- Select the Enable option, the desired domain, and the names of user accounts to be enabled; you can even import the users list from a CSV file. Click Apply.
» Start 30-day Free Trial
Limitations of using PowerShell to enable AD accounts
- You will not be able to enable AD accounts using PowerShell if you do not have sufficient permissions in AD. With ADManager Plus, users' privileges in native AD or Exchange doesn't have to be elevated to enable AD accounts.
- If you wish to enable AD accounts in bulk or use a CSV file to enable multiple AD accounts using PowerShell, the script has to be modified. With ADManager Plus though, as the import CSV option is built-in, you can use the enable users feature to enable just one account or multiple accounts at once.
- You must know how to run the scripts from the PowerShell window. ADManager Plus is purely GUI-based, allowing you to perform all management and reporting actions with just mouse clicks from its web-based console.
- Even a misplaced hyphen, a typo in the LDAP names, or lack of sufficient permission to configure any of the attributes used in the script will lead to errors. As all actions in ADManager Plus are GUI-driven, there is no need to write scripts, eliminating the chances of errors.