<?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 Querying AD accounts and email addresses in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Querying-AD-accounts-and-email-addresses/m-p/686380#M234150</link>
    <description>&lt;P&gt;I am able to pull my AD users account information successfully except for their email addresses.&amp;nbsp; What am I doing wrong? Apologize since I am still learning.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| inputlookup AD_Obj_User WHERE domain="mydomain"
| fields domain, sAMAccountName, userAccountControl, uac_details,domain, distinguishedName, mail, whenChanged,whenCreated
| table domain, sAMAccountName, userAccountControl, uac_details,domain, distinguishedName, mail, whenChanged,whenCreated
| eval uac_details=replace(mvjoin(uac_details,":"),"([\r\n]+)",":")
| makemv delim=":" uac_details
| search [| makeresults | eval uac_details=replace("#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#","#empty#","")
| makemv delim="," uac_details
| eval mfilt_uac=mvfilter(match(uac_details,"^\w+"))
| eval search=if(isnull(mfilt_uac),"","uac_details=\"".mvjoin(mfilt_uac,"\" AND uac_details=\"")."\"")
| table search]
| sort 0 sAMAccountName
| rename sAMAccountName AS "user", uac_details AS userAccountControl_Details&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 03 May 2024 23:48:04 GMT</pubDate>
    <dc:creator>Sotu</dc:creator>
    <dc:date>2024-05-03T23:48:04Z</dc:date>
    <item>
      <title>Querying AD accounts and email addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Querying-AD-accounts-and-email-addresses/m-p/686380#M234150</link>
      <description>&lt;P&gt;I am able to pull my AD users account information successfully except for their email addresses.&amp;nbsp; What am I doing wrong? Apologize since I am still learning.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| inputlookup AD_Obj_User WHERE domain="mydomain"
| fields domain, sAMAccountName, userAccountControl, uac_details,domain, distinguishedName, mail, whenChanged,whenCreated
| table domain, sAMAccountName, userAccountControl, uac_details,domain, distinguishedName, mail, whenChanged,whenCreated
| eval uac_details=replace(mvjoin(uac_details,":"),"([\r\n]+)",":")
| makemv delim=":" uac_details
| search [| makeresults | eval uac_details=replace("#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#,#empty#","#empty#","")
| makemv delim="," uac_details
| eval mfilt_uac=mvfilter(match(uac_details,"^\w+"))
| eval search=if(isnull(mfilt_uac),"","uac_details=\"".mvjoin(mfilt_uac,"\" AND uac_details=\"")."\"")
| table search]
| sort 0 sAMAccountName
| rename sAMAccountName AS "user", uac_details AS userAccountControl_Details&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 03 May 2024 23:48:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Querying-AD-accounts-and-email-addresses/m-p/686380#M234150</guid>
      <dc:creator>Sotu</dc:creator>
      <dc:date>2024-05-03T23:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Querying AD accounts and email addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Querying-AD-accounts-and-email-addresses/m-p/686417#M234159</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;It&amp;nbsp; could be a permissions issue you need &lt;STRONG&gt;read&lt;/STRONG&gt; the email address attribute ((&amp;amp;(objectClass=user)(objectCategory=person)(mail=*))) check the user permissions that is being &lt;STRONG&gt;used&lt;/STRONG&gt; to pull the LDAP data, see your AD admin. Or run something like the below to check under that user account.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;dsquery user -samid username | dsget user -email&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;If not, f&lt;/SPAN&gt;&lt;SPAN&gt;ind out how it’s being populated, normally its done via the ldap search command see references below.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Check the ldap search that creates the lookup and you should have the data there, this may have been created already as a secluded search. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Reference: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ldap Search using the command &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://docs.splunk.com/Documentation/SA-LdapSearch/3.0.8/User/Theldapsearchcommand" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/SA-LdapSearch/3.0.8/User/Theldapsearchcommand&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ldap Add-on&lt;BR /&gt;&lt;A href="https://docs.splunk.com/Documentation/SA-LdapSearch/3.0.8/User/AbouttheSplunkSupportingAdd-onforActiveDirectory" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/SA-LdapSearch/3.0.8/User/AbouttheSplunkSupportingAdd-onforActiveDirectory&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 14:02:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Querying-AD-accounts-and-email-addresses/m-p/686417#M234159</guid>
      <dc:creator>deepakc</dc:creator>
      <dc:date>2024-05-04T14:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Querying AD accounts and email addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Querying-AD-accounts-and-email-addresses/m-p/686423#M234160</link>
      <description>&lt;P&gt;The First Law of asking an answerable question states:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Present your dataset (anonymize as needed), illustrate desired output from illustrated dataset, explain the logic between illustrated dataset and desired output. (Without SPL.)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;If attempted SPL does not give desired output, also illustrate actual output (anonymize as needed), then explain its difference from desired results if it is not painfully clear.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;I am able to pull my AD users account information successfully except for their email addresses.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Can you explain from which source are you pulling AD info? &amp;nbsp;Your SPL only uses a lookup file. &amp;nbsp;Do you mean&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;lookup table&amp;nbsp;AD_Obj_User contains email addresses but the illustrated SPL does not output them, or&lt;/LI&gt;&lt;LI&gt;your effort to populate&amp;nbsp;AD_Obj_User fails to obtain email addresses from a legitimate AD source (as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79189"&gt;@deepakc&lt;/a&gt;&amp;nbsp;speculated)?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If former, what is the purpose of the SPL? &amp;nbsp;What is the content of AD_Obj_User?&amp;nbsp; What is the desired output and the logic between the content and desired output?&lt;/P&gt;&lt;P&gt;If latter, what is the purpose of showing SPL?&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 18:04:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Querying-AD-accounts-and-email-addresses/m-p/686423#M234160</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-05-04T18:04:17Z</dc:date>
    </item>
  </channel>
</rss>

