<?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 Cisco ISE and python Integration in Network Access Control</title>
    <link>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396149#M567021</link>
    <description>&lt;P&gt;I am&amp;nbsp; new&amp;nbsp; to cisco ISE and writing a python scripts to create internal user on ISE . I am having problem of executing it&amp;nbsp; on&amp;nbsp; cisco IISE .Can anyone help me out&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Apr 2021 18:09:38 GMT</pubDate>
    <dc:creator>RichardAcolatse8417</dc:creator>
    <dc:date>2021-04-30T18:09:38Z</dc:date>
    <item>
      <title>Cisco ISE and python Integration</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396149#M567021</link>
      <description>&lt;P&gt;I am&amp;nbsp; new&amp;nbsp; to cisco ISE and writing a python scripts to create internal user on ISE . I am having problem of executing it&amp;nbsp; on&amp;nbsp; cisco IISE .Can anyone help me out&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 18:09:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396149#M567021</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-04-30T18:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE and python Integration</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396621#M567058</link>
      <description>&lt;P&gt;This looks dup of &lt;A href="https://community.cisco.com/t5/network-access-control/ise-internal-user-creation-using-python-script/m-p/4396590" target="_self"&gt;ISE Internal user creation using Python script&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 May 2021 00:42:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396621#M567058</guid>
      <dc:creator>hslai</dc:creator>
      <dc:date>2021-05-02T00:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE and python Integration</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396735#M567064</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi hslai &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am try to&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;create internal&amp;nbsp;&amp;nbsp;users with my Python script. This is my code I&amp;nbsp;&amp;nbsp;created&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;#!/usr/bin/python&lt;BR /&gt;import http.client&lt;BR /&gt;import base64&lt;BR /&gt;import ssl&lt;BR /&gt;import sys&lt;BR /&gt;import os&lt;BR /&gt;argv = sys.argv[1]&lt;BR /&gt;print ("The name of the script: ", sys.argv[0])&lt;BR /&gt;print ("The argument are: ", argv)&lt;BR /&gt;#parameters&lt;/P&gt;&lt;P&gt;Id = sys.argv[4] # "B100"&lt;BR /&gt;userName = sys.argv[5] # "Robert"&lt;BR /&gt;firstName = sys.argv[6] # "Robert"&lt;BR /&gt;lastName = sys.argv[7] # "Mensah"&lt;BR /&gt;password = sys.argv[8] # "Password1"&lt;BR /&gt;emailAddress = sys.argv[9] # "rmensah@cisco.com&lt;BR /&gt;expiryDate = sys.argv[11] # “12/26/2020”&lt;BR /&gt;identityGroups = sys.argv[10] # “identityGroups”&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# host and authentication credentials&lt;BR /&gt;host = sys.argv[1] # "192.198”.1.1&lt;BR /&gt;user = sys.argv[2] # “ers-admin”&lt;BR /&gt;password = sys.argv[3] # “admin20!”&lt;/P&gt;&lt;P&gt;conn = http.client.HTTPSConnection("{}:9060".format(host), context=ssl.SSLContext(ssl.PROTOCOL_TLS))&lt;/P&gt;&lt;P&gt;creds = str.encode(':'.join((user, password)))&lt;BR /&gt;encodedAuth = bytes.decode(base64.b64encode(creds))&lt;/P&gt;&lt;P&gt;req_body_json = """{{&lt;/P&gt;&lt;P&gt;\"InternalUser"\ : {&lt;/P&gt;&lt;P&gt;"id" : "\{}\",&lt;/P&gt;&lt;P&gt;"userName" : "\{}\",&lt;/P&gt;&lt;P&gt;"description" : "\{}\",&lt;/P&gt;&lt;P&gt;"enabled" : true,&lt;/P&gt;&lt;P&gt;"email" : "\{}\",&lt;/P&gt;&lt;P&gt;"password" : "\{}\",&lt;/P&gt;&lt;P&gt;"firstName" : "\{}\",&lt;/P&gt;&lt;P&gt;"lastName" : "\{}\",&lt;/P&gt;&lt;P&gt;"changePassword" : true,&lt;/P&gt;&lt;P&gt;"identityGroups" : "\{}\",&lt;/P&gt;&lt;P&gt;"expiryDateEnabled" : false,&lt;/P&gt;&lt;P&gt;"expiryDate" : "\{}\",&lt;/P&gt;&lt;P&gt;"enablePassword" : "enablePassword",&lt;/P&gt;&lt;P&gt;"customAttributes" : {&lt;/P&gt;&lt;P&gt;"key1" : "value1",&lt;/P&gt;&lt;P&gt;"key2" : "value3"&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;"passwordIDStore" : "Internal Users"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}}&lt;BR /&gt;}}""".format(Id,UserNname,firstName,lastName,emailAddress,password,identityGroups,expiryDate)&lt;BR /&gt;headers = {&lt;BR /&gt;'accept': "application/json",&lt;BR /&gt;'content-type': "application/json",&lt;BR /&gt;'authorization': " ".join(("Basic",encodedAuth)),&lt;BR /&gt;'cache-control': "no-cache",&lt;BR /&gt;}&lt;BR /&gt;conn.request("POST", "/ers/config/internaluser/", headers=headers, body=req_body_json)&lt;BR /&gt;&lt;BR /&gt;es = conn.getresponse()&lt;BR /&gt;data = res.read()&lt;/P&gt;&lt;P&gt;print("Status: {}".format(res.status))&lt;BR /&gt;print("Header:\n{}".format(res.headers))&lt;BR /&gt;print("Body:\n{}".format(data.decode("utf-8")))&lt;BR /&gt;print (req_req_json)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got this error while&amp;nbsp; executing the above code&lt;/P&gt;&lt;P&gt;C:\Users\ghibuser\Desktop&amp;gt;python ISEInternalUserTest.py 192.198.1.1 ers-admin admin20! robert Robert Mensah Password1 rmensah@gha.com Employee 12/26/2020&lt;BR /&gt;The name of the script: ISEInternalUserTest.py&lt;BR /&gt;The argument are: 192.198.1.1&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\ghibuser\Desktop\ISEInternalUserTest.py", line 38, in &amp;lt;module&amp;gt;&lt;BR /&gt;req_body_json = """{{&lt;BR /&gt;IndexError: Replacement index 7 out of range for positional args tuple&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any support will be welcomed&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 10:33:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396735#M567064</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-05-03T10:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE and python Integration</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396830#M567077</link>
      <description>&lt;PRE&gt;python ISEInternalUserTest.py 192.198.1.1 ers-admin admin20! robert Robert Mensah Password1 rmensah@gha.com Employee 12/26/2020&lt;/PRE&gt;
&lt;P&gt;"12/26/2020" should be sys.argv[10] since sys.arg[1] is "192.198.1.1".&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 04:29:51 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396830#M567077</guid>
      <dc:creator>hslai</dc:creator>
      <dc:date>2021-05-03T04:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco ISE and python Integration</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396849#M567081</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/113005"&gt;@hslai&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code&amp;nbsp;&lt;/P&gt;&lt;P&gt;#!/usr/bin/python&lt;BR /&gt;import http.client&lt;BR /&gt;import base64&lt;BR /&gt;import ssl&lt;BR /&gt;import sys&lt;BR /&gt;import os&lt;BR /&gt;import urllib3&lt;/P&gt;&lt;P&gt;urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;argv = sys.argv[1]&lt;BR /&gt;print ("The name of the script: ", sys.argv[0])&lt;BR /&gt;print ("The argument are: ", argv)&lt;BR /&gt;#parameters&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;userName = sys.argv[5] # "robert"&lt;BR /&gt;firstName = sys.argv[6] # "Robert"&lt;BR /&gt;lastName = sys.argv[7] # " Mensah"&lt;BR /&gt;password = sys.argv[8] # "Password1"&lt;BR /&gt;emailAddress = sys.argv[9] # "rmensah@gh.com&lt;BR /&gt;expiryDate = sys.argv[10] # “12/26/2022”&lt;BR /&gt;identityGroups = sys.argv[4] # “Employee”&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# host and authentication credentials&lt;BR /&gt;host = sys.argv[1] # "192.198”.1.1&lt;BR /&gt;user = sys.argv[2] # “ers-admin”&lt;BR /&gt;password = sys.argv[3] # “admin20!”&lt;/P&gt;&lt;P&gt;conn = http.client.HTTPSConnection("{}:9060".format(host), context=ssl.SSLContext(ssl.PROTOCOL_TLS))&lt;/P&gt;&lt;P&gt;creds = str.encode(':'.join((user, password)))&lt;BR /&gt;encodedAuth = bytes.decode(base64.b64encode(creds))&lt;/P&gt;&lt;P&gt;req_body_json = """{{&lt;/P&gt;&lt;P&gt;\"InternalUser\" : {{&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;\"userName\" : "\{}\",&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;\"description"\ : "\{}\",&lt;/P&gt;&lt;P&gt;"enabled" : true,&lt;/P&gt;&lt;P&gt;\"email\" : "\{}\",&lt;/P&gt;&lt;P&gt;\"password\" : "\{}\",&lt;/P&gt;&lt;P&gt;\"firstName\" : "\{}\",&lt;/P&gt;&lt;P&gt;\"lastName\" : "\{}\",&lt;/P&gt;&lt;P&gt;\"changePassword\" : true,&lt;/P&gt;&lt;P&gt;\"identityGroups\" : "\{}\",&lt;/P&gt;&lt;P&gt;"expiryDateEnabled" : false,&lt;/P&gt;&lt;P&gt;"expiryDate" : "\{}\",&lt;/P&gt;&lt;P&gt;"enablePassword" : "enablePassword",&lt;/P&gt;&lt;P&gt;"customAttributes" : {&lt;/P&gt;&lt;P&gt;"key1" : "value1",&lt;/P&gt;&lt;P&gt;"key2" : "value3"&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;"passwordIDStore" : "Internal Users"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}}&lt;BR /&gt;}}""".format(userName,firstName,lastName,emailAddress,password,identityGroups,expiryDate)&lt;BR /&gt;headers = {&lt;BR /&gt;'accept': "application/json",&lt;BR /&gt;'content-type': "application/json",&lt;BR /&gt;'authorization': " ".join(("Basic",encodedAuth)),&lt;BR /&gt;'cache-control': "no-cache",&lt;BR /&gt;}&lt;BR /&gt;conn.request("POST", "/ers/config/internaluser/", headers=headers, body=req_body_json)&lt;BR /&gt;&lt;BR /&gt;es = conn.getresponse()&lt;BR /&gt;data = res.read()&lt;/P&gt;&lt;P&gt;print("Status: {}".format(res.status))&lt;BR /&gt;print("Header:\n{}".format(res.headers))&lt;BR /&gt;print("Body:\n{}".format(data.decode("utf-8")))&lt;/P&gt;&lt;P&gt;print(req_body_json)&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;&lt;P&gt;can you help me with this error&lt;/P&gt;&lt;P&gt;IndexError: Replacement index 7 out of range for positional args tuple&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 05:39:40 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-and-python-integration/m-p/4396849#M567081</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-05-03T05:39:40Z</dc:date>
    </item>
  </channel>
</rss>

