Splunk Search

ldapsearch not returning true/false for attr Enabled

marceloalejandr
Path Finder

For some reason the "Enabled" field is not return "true or false" when running ldapsearch from Splunk.  All the other fields return like sAMAccountName, cn, distinguishedName, etc but all the different combination tried so far have not returned value in the field.  We have confirmed there is a value in the field using cmdlet "get-aduser" so there is either a true or false for all users.   Here is an example of an ldapsearch query we've tried:

"| ldapsearch domain="x.xx.xxx.com" search="(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=512)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))" attrs="sAMAccountName, name, cn, co, st, whenCreated, accountExpires, Enabled, lastLogonTimestamp, title, physicalDeliveryOfficeName, manager, userAccountControl, distinguishedName, userPrincipalName"
| table sAMAccountName, name, cn, lastLogonTimestamp, Enabled, distinguishedName,userPrincipalName"

Any assistance is greatly appreciated.

Labels (1)
Tags (1)
0 Karma

marceloalejandr
Path Finder

In case anyone runs into this issue/question. the following ldapsearch returns all records that are Enabled =true.  However the Enabled field does not contain the value "true".   A second or follow-on eval statement to add the value "true" will be needed if this is what your report needs to show.   To see records that are Enabled=false change the "!" to "&" in the userAccountControl string.  

For records with Enabled=false use (&(userAccountControl:1.2.840.113556.1.4.803:=2)
For record with Enabled=true use (!(userAccountControl:1.2.840.113556.1.4.803:=2)

I hope this helps.

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...