<?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: How can we define a dynamic role based on user organizational unit in Active Directory ? in Workforce Identity Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411541#M1974</link>
    <description>&lt;P&gt;It worked fine last week, now I get an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;CODE&gt;An error occurred on distinguishedname script execution - The given key was not present in the dictionary.
   at System.Collections.Concurrent.ConcurrentDictionary`2.get_Item(TKey key)
   at dynamicIndexerSetter(Marshaller , JsInstance , JsInstance )
   at Jint.ExecutionVisitor.Visit(Indexer indexer)
   at Jint.ExecutionVisitor.Visit(MemberExpression expression)
   at Jint.ExecutionVisitor.Visit(AssignmentExpression statement)
   at Jint.ExecutionVisitor.Visit(BlockStatement statement)
   at Jint.ExecutionVisitor.Visit(TryStatement statement)&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Nov 2024 15:26:08 GMT</pubDate>
    <dc:creator>M.Guessant670318</dc:creator>
    <dc:date>2024-11-04T15:26:08Z</dc:date>
    <item>
      <title>How can we define a dynamic role based on user organizational unit in Active Directory ?</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411536#M1969</link>
      <description>&lt;P&gt;Created a dynamic role in CyberArk identity based on provided example to filter on organizational unit in AD&lt;/P&gt;&lt;CODE&gt;if (User.UserType == 'AD') {
    try {
        DN = User.Get('distinguishedname');
        username = User.Username;
        trace('UserType: ' + User.UserType);
        trace('DN: ' + DN);
        result = DN.search(/OU=XXX,...,DC=company,DC=com/i);
        trace('Results are in: ' + result);
        return (result &amp;gt; 0);
...&lt;/CODE&gt;&lt;P&gt;Seems to work, unfortunately not for all users, some have an empty DN, some have a value, in Test User I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;broken user:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;UserType: AD&lt;/P&gt;&lt;P&gt;DN: null&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;working user:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;UserType: AD&lt;/P&gt;&lt;P&gt;DN: CN=name,OU=XXX,OU=YYYY,DC=company,DC=com&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And of course the broken users are eventually not members of the dynamic role.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 15:09:20 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411536#M1969</guid>
      <dc:creator>M.Guessant670318</dc:creator>
      <dc:date>2024-10-24T15:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can we define a dynamic role based on user organizational unit in Active Directory ?</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411537#M1970</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DN = User.Properties.Properties['distinguishedName'];&lt;/P&gt;&lt;P&gt;trace('User: '+ DN);&lt;/P&gt;&lt;P&gt;result = DN.search(/OU=EARTH/i);&lt;/P&gt;&lt;P&gt;trace ('Results are in: '+ result);&lt;/P&gt;&lt;P&gt;if (result &amp;gt; 0) { return true;}&lt;/P&gt;&lt;P&gt;else {&lt;/P&gt;&lt;P&gt; return false; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Source: https://community.cyberark.com/s/article/CyberArk-Identity-Dynamic-Roles-by-OU?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 13:35:53 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411537#M1970</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2024-10-28T13:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can we define a dynamic role based on user organizational unit in Active Directory ?</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411538#M1971</link>
      <description>&lt;P&gt;Interesting, User.Get and User.Properties.Properties[] return a different result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Field_Content_versions_oct20__068Ht00000VfVoGIAV.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/90421i4043E3D772B708D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Field_Content_versions_oct20__068Ht00000VfVoGIAV.png" alt="Field_Content_versions_oct20__068Ht00000VfVoGIAV.png" /&gt;&lt;/span&gt;DN from properties: CN=user,OU=...&lt;/P&gt;&lt;P&gt;DN from User.Get: null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The properties.properties syntax triggers a warning but returns the right value, the User.Get returns null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the User.Get('distinguishedname') syntax is used in the "Include By Organization.js" sample inside CyberArk identity administration portal.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 13:41:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411538#M1971</guid>
      <dc:creator>M.Guessant670318</dc:creator>
      <dc:date>2024-10-28T13:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can we define a dynamic role based on user organizational unit in Active Directory ?</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411539#M1972</link>
      <description>&lt;P&gt;The false warning is a bug. Does that mean properties.properties worked?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 14:08:30 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411539#M1972</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2024-10-28T14:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can we define a dynamic role based on user organizational unit in Active Directory ?</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411540#M1973</link>
      <description>&lt;P&gt;Yes the User.Properties.Properties syntax seems to work fine, I updated my dynamic roles accordingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus:&lt;/P&gt;&lt;P&gt;- User.Get provided in sample rule is not reliable (working on some users, not on others)&lt;/P&gt;&lt;P&gt;- User.Properties.Properties is the right way, just ignore the false warning bug&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 14:19:26 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411540#M1973</guid>
      <dc:creator>M.Guessant670318</dc:creator>
      <dc:date>2024-10-28T14:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can we define a dynamic role based on user organizational unit in Active Directory ?</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411541#M1974</link>
      <description>&lt;P&gt;It worked fine last week, now I get an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;CODE&gt;An error occurred on distinguishedname script execution - The given key was not present in the dictionary.
   at System.Collections.Concurrent.ConcurrentDictionary`2.get_Item(TKey key)
   at dynamicIndexerSetter(Marshaller , JsInstance , JsInstance )
   at Jint.ExecutionVisitor.Visit(Indexer indexer)
   at Jint.ExecutionVisitor.Visit(MemberExpression expression)
   at Jint.ExecutionVisitor.Visit(AssignmentExpression statement)
   at Jint.ExecutionVisitor.Visit(BlockStatement statement)
   at Jint.ExecutionVisitor.Visit(TryStatement statement)&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 15:26:08 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/how-can-we-define-a-dynamic-role-based-on-user-organizational/m-p/1411541#M1974</guid>
      <dc:creator>M.Guessant670318</dc:creator>
      <dc:date>2024-11-04T15:26:08Z</dc:date>
    </item>
  </channel>
</rss>

