<?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: Splunk Support for Active Directory: How to search a list of users whose accounts will expire within 30 days of today's date? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277066#M32492</link>
    <description>&lt;P&gt;doubting this is the issue but I've added &lt;CODE&gt;tonumber&lt;/CODE&gt; to one of your evals.  Also added &lt;CODE&gt;DaysLeft&lt;/CODE&gt; to your table so you can see those details and get more ideas there:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup AGSEC_Users | eval AccountExpiryEpoch=strptime(accountExpires,"%Y-%m-%dT%H:%M:%SZ") | eval DaysLeft = tonumber((now() - AccountExpiryEpoch)/86400) | where DaysLeft&amp;lt;=30 | table displayName, sAMAccountName, accountExpires, AccountExpiryEpoch, DaysLeft
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 01 Jun 2016 10:27:30 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-06-01T10:27:30Z</dc:date>
    <item>
      <title>Splunk Support for Active Directory: How to search a list of users whose accounts will expire within 30 days of today's date?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277065#M32491</link>
      <description>&lt;P&gt;I'm trying to generate a list of users whose accounts will expire within 30 days of today's date.&lt;BR /&gt;
I first download the Active Directory users to a CSV lookup table using ldapsearch. Then I turn the &lt;CODE&gt;account expires&lt;/CODE&gt; field into Epoch time and I run the following search commands. I can't accurately get the accounts that expire in 30 days. I tested the epoch time using a epoch time converter which tested fine. Here are the commands I've tested.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup AGSEC_Users | eval AccountExpiryEpoch=strptime(accountExpires,"%Y-%m-%dT%H:%M:%SZ") | eval DaysLeft = (now() - AccountExpiryEpoch)/86400 | where DaysLeft&amp;lt;=30 | table displayName, sAMAccountName, accountExpires, AccountExpiryEpoch 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and I've tested this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup AGSEC_Users | eval AccountExpiryEpoch=strptime(accountExpires,"%Y-%m-%dT%H:%M:%SZ") | where AccountExpiryEpoch &amp;lt; relative_time(now(),"-30d@d") | table displayName, sAMAccountName, accountExpires, AccountExpiryEpoch
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;both return results but not accounts that will expire in within 30 days.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 08:55:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277065#M32491</guid>
      <dc:creator>dkorlat</dc:creator>
      <dc:date>2016-06-01T08:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Support for Active Directory: How to search a list of users whose accounts will expire within 30 days of today's date?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277066#M32492</link>
      <description>&lt;P&gt;doubting this is the issue but I've added &lt;CODE&gt;tonumber&lt;/CODE&gt; to one of your evals.  Also added &lt;CODE&gt;DaysLeft&lt;/CODE&gt; to your table so you can see those details and get more ideas there:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup AGSEC_Users | eval AccountExpiryEpoch=strptime(accountExpires,"%Y-%m-%dT%H:%M:%SZ") | eval DaysLeft = tonumber((now() - AccountExpiryEpoch)/86400) | where DaysLeft&amp;lt;=30 | table displayName, sAMAccountName, accountExpires, AccountExpiryEpoch, DaysLeft
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Jun 2016 10:27:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277066#M32492</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-06-01T10:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Support for Active Directory: How to search a list of users whose accounts will expire within 30 days of today's date?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277067#M32493</link>
      <description>&lt;P&gt;Assuming the accounts have not yet expired, the phrase &lt;CODE&gt;now() - AccountExpiryEpoch&lt;/CODE&gt; will produce a negative number.  I believe you want &lt;CODE&gt;AccountExpiryEpoch - now()&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 11:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277067#M32493</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-06-01T11:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Support for Active Directory: How to search a list of users whose accounts will expire within 30 days of today's date?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277068#M32494</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup AGSEC_Users | eval AccountExpiryEpoch=strptime(accountExpires,"%Y-%m-%dT%H:%M:%SZ") | where AccountExpiryEpoch &amp;lt; relative_time(now(),"+30d@d") AND AccountExpiryEpoch &amp;gt;=now() | table displayName, sAMAccountName, accountExpires, AccountExpiryEpoch
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Jun 2016 13:22:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277068#M32494</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-01T13:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Support for Active Directory: How to search a list of users whose accounts will expire within 30 days of today's date?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277069#M32495</link>
      <description>&lt;P&gt;Thanks that worked perfectly.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 22:37:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277069#M32495</guid>
      <dc:creator>dkorlat</dc:creator>
      <dc:date>2016-06-01T22:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Support for Active Directory: How to search a list of users whose accounts will expire within 30 days of today's date?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277070#M32496</link>
      <description>&lt;P&gt;I have the users email address from Active Directory in the lookup table. Is there a way Splunk can turn the users email address into a variable then send a email to the individual email addresses it finds in the report? Currently we send the report to the Service Desk and the Service Desk calls the user advising them they need to start the process in getting their accounts extended. It will be nice if Splunk could also email the users.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 23:23:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Support-for-Active-Directory-How-to-search-a-list-of/m-p/277070#M32496</guid>
      <dc:creator>dkorlat</dc:creator>
      <dc:date>2016-06-01T23:23:59Z</dc:date>
    </item>
  </channel>
</rss>

