🎉 Our Microsoft 365 Reporting & Management Tool is now available in Azure Marketplace 🚀
This website uses cookies to improve your experience. We'll assume you're ok with this. Know more.
Active Directory

How To Find Disabled Users in Active Directory

Disabled user accounts in Active Directory might seem harmless, but leaving them unmonitored can create serious security risks . If these accounts are unintentionally re-enabled, they could grant unauthorized access to sensitive resources. Additionally, they are often overlooked during security audits, resulting in security gaps and increased vulnerability. This guide will show you how to find and manage disabled user accounts in Active Directory to avoid unauthorized access.

Get List of Disabled Users in Active Directory Using ADUC

Active Directory Permission Required
Account Operators Least Privilege
Administrators Most Privilege
  • Open the Active Directory Users and Computers (ADUC) console.
  • Right click on your domain from the left pane and choose Find.
  • Choose the Common Queries option from the Find drop-down.
  • Enable the Disabled accounts check box under the Users tab and click Find Now.
  • Here, you can get a list of all disabled users in Active Directory.
Get List of Disabled Users in Active Directory Using ADUC

Find All Disabled Users in Active Directory Using ADAC

Active Directory Permission Required
Account Operators Least Privilege
Administrators Most Privilege
  • Open the Active Directory Administrative Center (ADAC) and navigate to the Global Search tab.
  • Choose the Convert to LDAP radio button and enter the following LDAP query to find all disabled accounts in Active Directory.
    (&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2))
  • Finally, hit the Apply button.
Find All Disabled Users in Active Directory Using ADAC

Export Disabled Users from Active Directory Using PowerShell

Active Directory Permission Required
Domain User Least Privilege
Administrators Most Privilege
  • While the above two approaches help to list all the disabled users in your Active Directory domain, it doesn’t provide a direct way to export them as a list.
  • To overcome this limitation, you can use the ‘Get-ADUser’ cmdlet to get disabled AD user accounts using PowerShell.
  • Execute the following cmdlet to export disabled users from Active Directory using PowerShell. Ensure that you replace <FilePath> with the desired path for your CSV file.
  • Windows PowerShell Windows PowerShell
     Get-ADUser -Filter { Enabled -eq $false } -Properties * |
    Select-Object Name, SAMAccountName, UserPrincipalName, DistinguishedName, AccountExpirationDate, LastLogonDate |
    Export-Csv -Path "<FilePath>" -NoTypeInformation
  • The exported CSV file provides a comprehensive view of each disabled user in your Active Directory, including key details such as name, SAM account name, user principal name, account expiration date, and last logon time.
Export Disabled Users from Active Directory Using PowerShell

Simplify Management – Spot and Manage All Disabled AD Accounts in Seconds!

AdminDroid’s Active Directory reporting tool is a powerful solution for admins, making it easier than ever to manage disabled users in AD. Here are some of the unique features of AdminDroid for efficient Active Directory disabled user management.

Efficiently Identify and Disable Inactive Users

Regularly monitor user activities to quickly spot and disable inactive users who are still enabled, optimizing resource allocation and improving overall system efficiency.

Establish a Routine for Reviewing Enabled User Events

Audit account-enabled events for user objects to detect unauthorized reactivation of disabled accounts in your on-premises Active Directory environment.

Track Sign-in Attempts by Disabled Users

Gain insights into log-in attempts from disabled users to detect unauthorized access and take corrective actions as needed.

Manage Locked-Out Users for Enhanced Security

Use the locked-out users report to identify temporarily locked accounts and take action by unlocking or disabling them for improved security.

Find Never Logged-In User Accounts and Disable Them

Leverage the never logged-in users report to find users who have never accessed Active Directory resources and disable them to improve security and reduce unused accounts.

Quickly Locate All Disabled Computers

Easily identify all disabled computer accounts in Active Directory to clean up vulnerable or unnecessary ones and make reactivation decisions with confidence.

Overall, the AdminDroid’s Active Directory management tool serves as a comprehensive, all-in-one solution for efficiently managing all your AD management tasks. With its advanced features such as visually appealing graphs, robust exporting options, detailed filtration, and extensive customization, disabled user management made simpler.

Explore a full range of reporting options

Important Tips

Always keep Account Management auditing enabled in your AD domain to find who disabled a user account and other related information.

Set an expiration date for user accounts in Active Directory to automate the disabling process and eliminate the need for manual intervention.

Configure logon hours to control when users can access the system to disable unauthorized logins during restricted periods.

Common Errors and Resolution Steps

Here are common issues and troubleshooting tips while managing disabled users in Active Directory to help you resolve them efficiently.

Error Disable-ADAccount : Insufficient access rights to perform the operation.

This error occurs when you try to execute the ‘Disable-ADAccount’ cmdlet without necessary permissions.

Fix Ensure you're connected with at least Account Operator privileges to disable an account.

Error Your account has been disabled. Please see your system administrator.

This error occurs when you try to log in to an AD account that was disabled by the administrator.

Fix Contact your administrator to enable the user account in Active Directory.

Error The search filter cannot be recognized.

This error occurs when you have incorrectly provided the LDAP query in Active Directory to filter disabled users.

Fix Use the following LDAP query correctly to list only the disabled users in Active Directory.
(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2))
Frequently Asked Questions

Discover How to Manage Disabled User Accounts in Active Directory Efficiently

1. How to find all disabled users in a specific organizational unit in Active Directory?

Organizational Units (OUs) in Active Directory are used to organize users, groups, and other objects based on roles, departments, or similar criteria. Regularly monitoring disabled user accounts within a specific OU helps manage these accounts more effectively. This allows admins to re-enable accounts or remove them to keep the directory secure and organized, with an up-to-date record of account status.

List all disabled users in a specific OU using ADUC

  • In the Active Directory Users and Computers console, go to the Filter option in the toolbar.
  • Choose the Create custom filter option and click the Customize button.
  • Switch to the Advanced tab and enter the following LDAP query, then click OK.
find-all-disabled-users-in- specific-ou
(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2))

After completing the above steps , navigate to your OU to view all disabled users within it. However, this approach is limited to displaying disabled users only in the specified OU and does not include users in nested OUs. To view disabled users in nested OUs, PowerShell provides a more comprehensive solution.

Find all disabled users in an OU using PowerShell

Execute the following PowerShell cmdlet to get all disabled users in an OU and from its nested OUs.

Get-ADUser -Filter { Enabled -eq $false } -SearchBase "<OU'sDistinguishedName>" -Properties * |
Select-Object Name, SAMAccountName, UserPrincipalName, DistinguishedName, AccountExpirationDate, LastLogonDate |
Export-Csv -Path "<FilePath>" -NoTypeInformation

Here, replace <OU’sDistinguishedName> with the distinguished name of the OU and <FilePath> with the desired location for your CSV file. To find the distinguished names of all OUs in your organization, use the following command.

Get-ADOrganizationalUnit -Filter * | Select Name, DistinguishedName

Avoid complications with ease! Leverage AdminDroid’s account disabled users report and its rich filtering capability to quickly identify disabled users in a specific OU.

2. How to disable a user in Active Directory?

Disabling user accounts in Active Directory prevents them from accessing network resources. This is often done when there are security breaches, suspicious logins, or as a first step when a user leaves the organization. It prevents the user from accessing resources within the network, while preserving their data and settings.

Disable an Active Directory user account

To disable a user account in Active Directory, follow these steps:

  • Open Active Directory Users and Computers (ADUC) console.
  • Locate the user account you want to disable.
  • Right-click the user account and select Disable Account. Then, click OK for confirmation.
disable-a-user-in-active-directory

If you want to re-enable a user's account in Active Directory, repeat the same procedure, but select the Enable Account option.

Tip: To quickly check if an AD user is disabled in ADUC, look for a small black arrow pointing downward on top of the regular user icon.

Say goodbye to the hassle of manually finding and disabling users in Active Directory – with AdminDroid, it's just a few clicks away!

  • In addition to the robust reports on locked-out, inactive, expired users, etc., AdminDroid's management capabilities help you disable users directly from the report.
  • To disable user(s), simply select them and click the Disable User management button available at the bottom of the report. Then confirm the action to disable.
disable-ad-users-admindroid

3. How to disable multiple users in Active Directory?

Manually disabling multiple user accounts via the ADUC console can be time-consuming. To overcome this limitation, you can follow the steps below to disable bulk users in Active Directory using PowerShell.

  • First, create a CSV file containing the SAM account name of the users you want to disable. The CSV file should be formatted as shown here.
  • Then, run the following PowerShell command to disable all the users listed in the file.
disable-multiple-users-in-active-directory-csv
Import-Csv "<CSVFilePath>" | ForEach-Object { Disable-ADAccount -Identity $_.SAMAccountName }

Similarly, if you need to re-enable multiple user accounts, follow the same approach but replace the ‘Disable-ADAccount’ cmdlet with ‘Enable-ADAccount.’

Import-Csv "<CSVFilePath>" | ForEach-Object { Enable-ADAccount -Identity $_.SAMAccountName }

Disable AD users in a specific organizational unit (OU)

You can use the cmdlet below to disable all users in a specific organizational unit in Active Directory.

Get-ADUser -Filter * -SearchBase "<OU’sDistinguishedName>" | Disable-ADAccount 

Automatically disable inactive AD user accounts

To disable inactive AD accounts after X days of inactivity, you can run the following PowerShell script replacing the <InactiveDays> with the days of inactivity.

$DaysSinceLastLogon = ((Get-Date).AddDays(-<InactiveDays>)).Date
Get-ADUser -Filter * -Properties LastLogonDate | Where-Object {$_.LastLogon -lt $DaysSinceLastLogon -and 
$_.Enabled -eq $true} | ForEach-Object {
    Disable-ADAccount -Identity $_.SamAccountName
    Write-Host "Disabled account: $($_.SamAccountName)"
}

Helpful Hint: To automatically disable inactive users in Active Directory at specific intervals, design a PowerShell script and schedule the execution using Task Scheduler.

4. How to find out who disabled a user account in Active Directory?

To determine who disabled an Active Directory account or when it was disabled, ensure that the subcategory ‘Audit User Account Management’ is enabled in the Account Management audit. Without enabling this, the account disable action won’t be logged or available for review.

If auditing is enabled at the time of the action, it will be logged in the domain controller (DC). The event ID for the account disable action is 4725, and it is logged whenever an administr ator disables an AD user account.

Check who disabled an AD account and when it was disabled

  • Open Event Viewer on a domain controller where the event is performed and go to Windows Logs»Security.
  • Right click on the Security option and choose Filter Current Log.
  • Search for event ID ‘4725’ to review all user account disability events.
audit-disabled-users-activity-in-ad

While the above approach lists all events related to disabled user accounts, it can be difficult to navigate through each event to identify who performed the action and when. To address this, you can identify who disabled the account and get the AD user disabled date using PowerShell.

  • Run the cmdlet below, replacing <SAMAccountName> with the specific username you are searching for.
    Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4725} |
    Where-Object { $_.Message -match 'Target Account:\s+Security ID:\s+[^\r\n]+\s+Account Name:\s+<SAMAccountName>' } |
    Select-Object TimeCreated, Message | fl
get-ad-user-disabled-date-using-powershell

You can also add start and end date parameters to this PowerShell script to find user accounts disabled in last x days.

Note: Both methods must be performed on the domain controller where the disable action occurred. If your Active Directory has multiple domain controllers, auditing becomes more complex as you need to search for events on each one.

Take the hassle out of switching between multiple domain controllers to check when and who disabled an AD account!

  • With AdminDroid, you can easily bypass the complexities of tracking across different DCs as it collects audit data from all your domain controllers in one place.
  • The disabled user events report lists audit events for disabled user accounts in your Active Directory, including details such as the time, action performer, event location, and more.
disabled-user-events-admindroid

5. What the user accounts in Active Directory that are disabled by default?

When you try to get a list of disabled users in your Active Directory, you may find certain accounts that are disabled by default. Refer to the section below to learn about such common accounts and understand the reasons for their default disabled status.

  • Guest account The Guest account is a default local account that provides limited access to the computer. By default, guest account has a blank password, which allows them to sign in. This account is disabled by default to prevent potential unauthorized access, as it can be easily misused without proper authentication.
  • KRBTGT account The KRBTGT account is a local account in Active Directory that functions as a service account for the Key Distribution Center (KDC) service. Since it is essential for Kerberos authentication to generate ticket-granting tickets (TGTs), this account is automatically created when a new domain is set up. The KRBTGT account is sensitive and cannot be delegated, deleted, renamed, or enabled.
  • HelpAssistant account The HelpAssistant account is used for remote assistance sessions. This account is disabled by default and is only activated when a user sends an invitation for remote assistance. It provides limited access to the computer during the session and is disabled when no requests are pending.
  • DefaultAccount account The Default System Managed Account (DSMA), also known as DefaultAccount, is a user account type used to run processes that are either multi-user aware or user-agnostic. By default, it is disabled on the desktop editions and on the Server OS with desktop experience. The DSMA is a part of the System Managed Accounts group, and both the account and group are created during the first boot in the Security Accounts Manager (SAM).

6. What is the difference between disabled, expired, locked and inactive user accounts in Active Directory?

Active Directory user accounts can be in different states based on factors like administrative actions, account expiration, inactivity or locked. Understanding the differences such account statues is important for managing accounts, security, and user lifecycles. This table helps clarify these states through a simple comparison.

difference-between-active-directory-user-state

Kickstart Your Journey With
AdminDroid

Your Microsoft 365 Companion with Enormous Reporting Capabilities

Download Now
User Help Manuals Compliance Docs
x
Delivering Reports on Time
Want a desired Microsoft 365 reports every Monday morning? Ensure automated report distribution and timely delivery with AdminDroid's Scheduling to your email anytime you need.
Delivering Reports on Time
Schedule tailored reports to execute automatically at the time you set and deliver straight to the emails you choose. In addition, you can customize report columns and add inteligent filtering to the activities just from the previous day to suit your Microsoft 365 report requirements.
Set It, Schedule It, See Results- Your Reports, Your Way, On Your Time!
Time Saving
Automation
Customization
Intelligent Filtering
Give Just the Right Access to the Right People
Grant fine-tuned access to any Microsoft 365 user with AdminDroid’s Granular Delegation and meet your organization’s security and compliance requirements.
Give Just the Right Access to the Right People
Create custom roles loaded with just the right permissions and give access to admins or normal users within AdminDroid. The result? A streamlined Microsoft 365 management experience that aligns your organization's security protocols and saves your invaluable time and effort.
Align, Define, Simplify: AdminDroid's Granular Delegation
Smart Organizational Control
Effortless M365 Management
Simplified Access
Advanced Alerts at a Glance
Receive quick notifications for malicious Microsoft 365 activities. Engage with the AdminDroid’s real-time alert policies crafted to streamline your security investigations.
Advanced Alerts at a Glance
Stay informed of critical activities like suspicious emails and high-risk logins, bulk file sharing, etc. Through creating and validating ideal alert policies, AdminDroid provides a comprehensive approach to real-time monitoring and management of potential threats within your organization.
AdminDroid Keeps You Always Vigilant, Never Vulnerable!
Proactive Protection
Real-time Monitoring
Security Intelligence
Threat Detection
Merge the Required Data to One Place
Combine multiple required columns into one comprehensive report and prioritize the information that matters most to you with AdminDroid’s Advanced Column Customization.
Merge the Required Data to One Place
This column merging capability offers a flexible way to add different columns from various reports and collate all the essential data in one place. Want to revisit the customized report? Save it as a 'View’, and your unique report is ready whenever you need it.
Merge with Ease and Save as Views!
Custom Reporting
Unique View
Desired Columns
Easy Data Interpretation
Insightful Charts and Exclusive Dashboards
Get a quick and easy overview of your tenant's activity, identify potential problems, and take action to protect your data with AdminDroid’s Charts and Dashboards.
Insightful Charts and Exclusive Dashboards
With AdminDroid charts and dashboards, visualize your Microsoft 365 tenant in ways you've never thought possible. It's not just about viewing; it's about understanding, controlling, and transforming your Microsoft 365 environment.
Explore Your Microsoft 365 Tenant in a Whole New Way!
Executive overviews
Interactive insights
Decision-making
Data Visualization
Efficient Report Exporting for Microsoft 365
Downloading your reports in the right file format shouldn’t be a hassle with AdminDroid’s Report Export. Experience seamless report exporting in various formats that cater to your needs.
Efficient Report Exporting for Microsoft 365
Navigate through diverse options and export Microsoft 365 reports flawlessly in your desired file format. Tailor your reports precisely as you need them and save them directly to your computer.
Take Control, Customize and Deliver- Your Office 365 Data, Exported in Your Way!
Easy Export
Seamless Downloading
Data Control
Manage Microsoft 365

Get AdminDroid Office 365 Reporter Now!