<?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: Unable to add a MAC to an identity group, if the MAC (endpoint) is already in the system in Network Access Control</title>
    <link>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3904248#M470706</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;You can check if the endpoint exists and update it and if not (else) you create it like your doing.&lt;BR /&gt;You can insert that condition if else in your loop where you check mac in macs.</description>
    <pubDate>Wed, 07 Aug 2019 03:13:56 GMT</pubDate>
    <dc:creator>Francesco Molino</dc:creator>
    <dc:date>2019-08-07T03:13:56Z</dc:date>
    <item>
      <title>Unable to add a MAC to an identity group, if the MAC (endpoint) is already in the system</title>
      <link>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3904181#M470705</link>
      <description>&lt;P&gt;Here is a rough approximation of what I'm doing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            var envelope = new XmlDocument();

            var ns = new XmlNamespaceManager(envelope.NameTable);
            ns.AddNamespace("ns3", "identity.ers.ise.cisco.com");

            var requestNode = envelope.CreateElement("ns3", "endpointBulkRequest", "identity.ers.ise.cisco.com");

            var mtAttr = envelope.CreateAttribute("resourceMediaType");
            mtAttr.InnerText = "vnd.com.cisco.ise.ers.identity.endpoint.1.0+xml";
            requestNode.Attributes.Append(mtAttr);

            var otAttr = envelope.CreateAttribute("operationType");
            otAttr.InnerText = "create";
            requestNode.Attributes.Append(otAttr);

            var resourceList = envelope.CreateElement("ns3","resourcesList", "identity.ers.ise.cisco.com");

            var i = 0;
            foreach (var mac in macs)
            {
                var description = descriptions[i];
                i++;
                var resource = envelope.CreateElement("ns3", "endpoint", "identity.ers.ise.cisco.com");

                // Add attributes to the endpoint element
                var descAttr = envelope.CreateAttribute("description");
                descAttr.InnerText = description;
                resource.Attributes.Append(descAttr);

                var nameAttr = envelope.CreateAttribute("name");
                nameAttr.InnerText = $"Device MAC: {mac}";
                resource.Attributes.Append(nameAttr);

                // Add child elements to the endpoint element
                var groupId = envelope.CreateElement("groupId");
                groupId.InnerText = _config.IseGroupId;
                resource.AppendChild(groupId);

                var identityStore = envelope.CreateElement("identityStore");
                resource.AppendChild(identityStore);

                var identityStoreId = envelope.CreateElement("identityStoreId");
                resource.AppendChild(identityStoreId);

                var macElem = envelope.CreateElement("mac");
                macElem.InnerText = mac;
                resource.AppendChild(macElem);

                var staticGroupAssignment = envelope.CreateElement("staticGroupAssignment");
                staticGroupAssignment.InnerText = "true";
                resource.AppendChild(staticGroupAssignment);

                var staticProfileAssignment = envelope.CreateElement("staticProfileAssignment");
                staticProfileAssignment.InnerText = "false";
                resource.AppendChild(staticProfileAssignment);

                resourceList.AppendChild(resource);
            }

            requestNode.AppendChild(resourceList);
            envelope.AppendChild(requestNode);&lt;/PRE&gt;&lt;P&gt;And that is being sent to `https://{my-instance}:9060/ers/config/endpoint/bulk`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And it works fine, except when a MAC address (endpoint) is already in the system (perhaps in another identity group, perhaps just unattached, I haven't checked), in which case it will not be added to the current identity group.&amp;nbsp; How can I overcome this?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 23:33:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3904181#M470705</guid>
      <dc:creator>SamuelFullman6827</dc:creator>
      <dc:date>2019-08-06T23:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add a MAC to an identity group, if the MAC (endpoint) is already in the system</title>
      <link>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3904248#M470706</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;You can check if the endpoint exists and update it and if not (else) you create it like your doing.&lt;BR /&gt;You can insert that condition if else in your loop where you check mac in macs.</description>
      <pubDate>Wed, 07 Aug 2019 03:13:56 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3904248#M470706</guid>
      <dc:creator>Francesco Molino</dc:creator>
      <dc:date>2019-08-07T03:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add a MAC to an identity group, if the MAC (endpoint) is already in the system</title>
      <link>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3904516#M470707</link>
      <description>Your script is working as expected since you are only utilizing create. Focus on other CRUD options like retrieve and update for the already existing hosts. I have been able to accomplish this using python and requests.put/requests.get. A few things you could focus on in your are:&lt;BR /&gt;xx/ers/config/endpoint?filter=mac.EQ."+ {MAC} -- for your retrieve/get&lt;BR /&gt;xx/ers/config/endpoint/"+ {variable that stores endpoint ID} -- for your update/put&lt;BR /&gt;&lt;BR /&gt;Good luck &amp;amp; HTH!</description>
      <pubDate>Wed, 07 Aug 2019 12:05:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3904516#M470707</guid>
      <dc:creator>Mike.Cifelli</dc:creator>
      <dc:date>2019-08-07T12:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add a MAC to an identity group, if the MAC (endpoint) is already in the system</title>
      <link>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3905281#M470708</link>
      <description>&lt;P&gt;Can you paste in the XML document you use for the update?&amp;nbsp; And I'm wondering:&lt;/P&gt;&lt;P&gt;1. does that move the endpoint out of any other identity group(s) - which is not objectionable in my case but good-to-know, and&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. can an update be done in bulk?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 13:43:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3905281#M470708</guid>
      <dc:creator>SamuelFullman6827</dc:creator>
      <dc:date>2019-08-08T13:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add a MAC to an identity group, if the MAC (endpoint) is already in the system</title>
      <link>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3905550#M470711</link>
      <description>1: The requests.put will move the endpoint from one group to another group. Just specify staticGroupAssignment to true, and specify your groupId in your json.&lt;BR /&gt;2: I have not attempted bulk. I developed a script for single endpoints. However, I do not see why you couldnt loop through a csv file for your MACs, use requests.get, and store the results to later reference in your "updating of the group assignment" requests.put.</description>
      <pubDate>Thu, 08 Aug 2019 18:50:46 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3905550#M470711</guid>
      <dc:creator>Mike.Cifelli</dc:creator>
      <dc:date>2019-08-08T18:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add a MAC to an identity group, if the MAC (endpoint) is already in the system</title>
      <link>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3905745#M470713</link>
      <description>You can do an update on multiple devices by looping on your csv or other db.&lt;BR /&gt;I did it for a customer looping on an sql db.</description>
      <pubDate>Fri, 09 Aug 2019 02:43:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/unable-to-add-a-mac-to-an-identity-group-if-the-mac-endpoint-is/m-p/3905745#M470713</guid>
      <dc:creator>Francesco Molino</dc:creator>
      <dc:date>2019-08-09T02:43:15Z</dc:date>
    </item>
  </channel>
</rss>

