question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filter disabled users on AD

See original GitHub issue

I have just migrated from ldapjs and appreciate changes and corrections made on the code. Nevertheless, a filter using previously with ldapjs not work. It’s normaly should remove desactivate users on AD (see last part of filter below).

const searchOptions = {
            scope: 'sub',
            sizeLimit: 50,
            attributes: ["sAMAccountName", "name", "mail", "telephoneNumber", "sn", "givenName"],
            filter: '(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))'
        };

Without userAccountControl Filter, I’ve got all users but with I’ve an empty result.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lennarkivistikcommented, May 17, 2019

I can confirm this works now. user is not listed when disabled and reappears once enabled in Active Directory my filter looked like this:

(|(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(Department=*)))
1reaction
jgeurtscommented, May 9, 2019

Looks like I was unnecessarily escaping filter names & values. Can you please try v1.6.0 and see if that resolves your issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Find Disabled Active Directory User Accounts
1. Run Disabled Users Report ... Click on Reports and under Account Status click on Disabled Users. Next, click the run button to...
Read more >
How to Find Disabled Users in AD with or without PowerShell
Learn how to find disabled users in AD and export the list to a CSV file using a PowerShell script or Netwrix Auditor...
Read more >
PowerShell command to find all disabled users in Active ...
For example, this command will show the samAccountName, first name, and last name of the disabled users. Get-ADUser -Filter {Enabled -eq $false} ...
Read more >
How can I create a filter in Active Directory to show only ...
In Active Directory, it is easy to create a filter to show only Disabled Computer Accounts by ticking the box "Disabled Accounts" in...
Read more >
LDAP/AD Filter disabled users? - Openfire Support
Well, I finally got everything up and running with all filters in place in a test environment but I have one issue. In...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found