<?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: ISE Internal User Creation with Python Program in Network Access Control</title>
    <link>https://community.cisco.com/t5/network-access-control/ise-internal-user-creation-with-python-program/m-p/4397702#M567122</link>
    <description>&lt;P&gt;Can I use this Guest User Creation&amp;nbsp; script for Internal User format as well .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.cisco.com/docs/identity-services-engine/3.0/#!create-guest-user" target="_blank"&gt;https://developer.cisco.com/docs/identity-services-engine/3.0/#!create-guest-user&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 May 2021 16:50:59 GMT</pubDate>
    <dc:creator>RichardAcolatse8417</dc:creator>
    <dc:date>2021-05-04T16:50:59Z</dc:date>
    <item>
      <title>ISE Internal User Creation with Python Program</title>
      <link>https://community.cisco.com/t5/network-access-control/ise-internal-user-creation-with-python-program/m-p/4397406#M567107</link>
      <description>&lt;P&gt;Hello Everyone ,&lt;/P&gt;&lt;P&gt;I like to create Internal&amp;nbsp; User with python scripts but I got an error&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&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 8 out of range for positional args tuple&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my command for run my python code for ISE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;python ISEInternalUserTest.py 192.198.1.2 ers-admin admin robert Robert Mensah Password1 rmensah@gmail.com Employee 12/27/2021&lt;/P&gt;&lt;P&gt;Any suggestions are welcome to help me run this code for my work project better&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 10:04:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/ise-internal-user-creation-with-python-program/m-p/4397406#M567107</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-05-18T10:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: ISE Internal User Creation with Python Program</title>
      <link>https://community.cisco.com/t5/network-access-control/ise-internal-user-creation-with-python-program/m-p/4397607#M567120</link>
      <description>&lt;P&gt;Richard,&lt;/P&gt;
&lt;P&gt;Many of your questions are answered in the document &lt;A href="https://community.cisco.com/t5/security-documents/ise-ers-api-examples/ta-p/3622623" target="_self"&gt;ISE ERS API Examples.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;We have an example of creating a user under &lt;A href="https://community.cisco.com/t5/security-documents/ise-ers-api-examples/ta-p/3622623#toc-hId--524760982" rel="nofollow noopener noreferrer" target="_blank"&gt;Create an Internal User with cURL and JSON&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This shows you what the JSON data looks like that you need to send to ISE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used my &lt;A href="https://github.com/1homas/ise-postman-collections" target="_self"&gt;&lt;STRONG&gt;Postman collection for the ISE ERS APIs&lt;/STRONG&gt;&lt;/A&gt; to generate the Python code below. Please watch our &lt;A href="https://www.youtube.com/watch?v=DNYaFl-8zWk" target="_self"&gt;&lt;STRONG&gt;ISE REST API webinar&lt;/STRONG&gt;&lt;/A&gt; for how I generated this code as a starting point for your project. I highly recommend you watch the entire webinar.&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=DNYaFl-8zWk&amp;amp;t=3227s" target="_blank"&gt;53:47&lt;/A&gt; &lt;STRONG&gt;Postman Code Snippets&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you get the basic submission working, I recommend using the Python library &lt;FONT face="courier new,courier"&gt;argparse&lt;/FONT&gt; for command line arguments in your program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="color: #000000; background-color: #fffffe; font-family: 'IBMPlexMono, Monaco, 'Courier New', monospace', Menlo, Monaco, 'Courier New', monospace; font-weight: normal; font-size: 12px; line-height: 18px; white-space: pre;"&gt;
&lt;PRE&gt;&lt;SPAN style="color: #800555; font-weight: bold;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; requests&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800555; font-weight: bold;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; json&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;url = &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;"https://ise.securitydemo.net:9060/ers/config/internaluser"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;payload = json.dumps({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #2a00ff;"&gt;"InternalUser"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;: {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #2a00ff;"&gt;"name"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;"{{username}}"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #2a00ff;"&gt;"password"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;"{{password}}"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #2a00ff;"&gt;"description"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;"{{description}}"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;})&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;# You will need to update this with your username+password credentials&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;headers = {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #2a00ff;"&gt;'Content-Type'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;'application/json'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #2a00ff;"&gt;'Accept'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;'application/json'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #2a00ff;"&gt;'Authorization'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;'Basic e3tyZXN0X3VzZXJuYW1lfX06e3tyZXN0X3Bhc3N3b3JkfX0='&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;response = requests.request(&lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;"POST"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;, url, headers=headers, data=payload)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800555; font-weight: bold;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(response.text)&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 14:30:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/ise-internal-user-creation-with-python-program/m-p/4397607#M567120</guid>
      <dc:creator>thomas</dc:creator>
      <dc:date>2021-05-04T14:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: ISE Internal User Creation with Python Program</title>
      <link>https://community.cisco.com/t5/network-access-control/ise-internal-user-creation-with-python-program/m-p/4397702#M567122</link>
      <description>&lt;P&gt;Can I use this Guest User Creation&amp;nbsp; script for Internal User format as well .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.cisco.com/docs/identity-services-engine/3.0/#!create-guest-user" target="_blank"&gt;https://developer.cisco.com/docs/identity-services-engine/3.0/#!create-guest-user&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 16:50:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/ise-internal-user-creation-with-python-program/m-p/4397702#M567122</guid>
      <dc:creator>RichardAcolatse8417</dc:creator>
      <dc:date>2021-05-04T16:50:59Z</dc:date>
    </item>
  </channel>
</rss>

