<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Active Directory - Finding if an account is enabled in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Active-Directory-Finding-if-an-account-is-enabled/m-p/40663#M9391</link>
    <description>&lt;P&gt;Is there a reason why you don't pull this data out of Event logs instead of monitoring AD?&lt;/P&gt;

&lt;P&gt;In Event logs, you will easily see when the user logged in last time. Regarding enabled accounts, check EventCode 626 on Windows 2003 or EventCode 4722 on Windows 2008. Splunk will automatically extract these Event codes, so a search such as this one:&lt;/P&gt;

&lt;P&gt;index=windows EventCode=626 OR EventCode=4722&lt;/P&gt;

&lt;P&gt;will print all enabled accounts.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2010 01:46:23 GMT</pubDate>
    <dc:creator>bojanz</dc:creator>
    <dc:date>2010-09-01T01:46:23Z</dc:date>
    <item>
      <title>Active Directory - Finding if an account is enabled</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Active-Directory-Finding-if-an-account-is-enabled/m-p/40661#M9389</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am monitoring Active Directory with Splunk and have two questions:&lt;/P&gt;

&lt;P&gt;1.) How do I format time in a search?  I need to report on a specific user sets last logon time but it keeps returning in msecs (?).  How can I do in search time formatting?  I am actually having this issue across a couple searches and not just with the AD LastLogon.&lt;/P&gt;

&lt;P&gt;2.) Is there a way to find the status of a specific user account?  We have vendor accounts that a third party can use to get into some systems that they service, however, the accounts are disabled until they contact a proper person to enable them.  I would like to run a report and return the status of the accounts every morning or list the accounts that are enabled.  Is there a way to glean this from the AD data that Splunk monitors?&lt;/P&gt;

&lt;P&gt;Thanks for your time and help.&lt;/P&gt;

&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2010 21:44:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Active-Directory-Finding-if-an-account-is-enabled/m-p/40661#M9389</guid>
      <dc:creator>kholleran</dc:creator>
      <dc:date>2010-08-31T21:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Active Directory - Finding if an account is enabled</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Active-Directory-Finding-if-an-account-is-enabled/m-p/40662#M9390</link>
      <description>&lt;P&gt;The time format is possibly in Microsoft &lt;CODE&gt;Ticks&lt;/CODE&gt; (and if you post examples we can verify), which you can convert with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval epochlogintime = (logintime-621355968000000000)/10000000
    | eval readabletime = strptime(epochlogintime,"%y-%m-%d %H:%M:%S)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As for the second question, you probably need to look at the AD field &lt;CODE&gt;userAccountControl&lt;/CODE&gt;. This field is a bitmask field. We don't have bitwise operations in Splunk search language, but the disabled bit is 0x2 (or bit 2), so you can do: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval isDisabled = if((userAccountControl%4)&amp;gt;=2),"disabled","enabled")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Aug 2010 22:16:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Active-Directory-Finding-if-an-account-is-enabled/m-p/40662#M9390</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-08-31T22:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Active Directory - Finding if an account is enabled</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Active-Directory-Finding-if-an-account-is-enabled/m-p/40663#M9391</link>
      <description>&lt;P&gt;Is there a reason why you don't pull this data out of Event logs instead of monitoring AD?&lt;/P&gt;

&lt;P&gt;In Event logs, you will easily see when the user logged in last time. Regarding enabled accounts, check EventCode 626 on Windows 2003 or EventCode 4722 on Windows 2008. Splunk will automatically extract these Event codes, so a search such as this one:&lt;/P&gt;

&lt;P&gt;index=windows EventCode=626 OR EventCode=4722&lt;/P&gt;

&lt;P&gt;will print all enabled accounts.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2010 01:46:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Active-Directory-Finding-if-an-account-is-enabled/m-p/40663#M9391</guid>
      <dc:creator>bojanz</dc:creator>
      <dc:date>2010-09-01T01:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Active Directory - Finding if an account is enabled</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Active-Directory-Finding-if-an-account-is-enabled/m-p/40664#M9392</link>
      <description>&lt;P&gt;You forgot another opening parenthesis:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;your base search&lt;/EM&gt; ... | eval isDisabled = if(((userAccountControl%4)&amp;gt;=2),"disabled","enabled")&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:53:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Active-Directory-Finding-if-an-account-is-enabled/m-p/40664#M9392</guid>
      <dc:creator>insomniacnerd94</dc:creator>
      <dc:date>2019-08-07T18:53:11Z</dc:date>
    </item>
  </channel>
</rss>

