<?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 Visual Basic script via API. How to add changes in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/visual-basic-script-via-api-how-to-add-changes/m-p/512076#M3096</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have configured a script in Visual Basic to disconnect all the GP VPN users logged but now I need to make an exception in order to not disconnect only one user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know how to code this exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After reading all the users logged in the firewall I make the following to disconnect them:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;j = 0;&lt;BR /&gt;while (user1[j] != null)&lt;BR /&gt;{&lt;BR /&gt;if (user1[j] != "")&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;&lt;BR /&gt;System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };&lt;BR /&gt;System.Net.WebRequest solicitud = System.Net.WebRequest.Create("https://" + ip_pa1 + "/api/?type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;global-protect-gateway&amp;gt;&amp;lt;client-logout&amp;gt;&amp;lt;gateway&amp;gt;" + pa_gw + "&amp;lt;/gateway&amp;gt;&amp;lt;user&amp;gt;" + user1[j] + "&amp;lt;/user&amp;gt;&amp;lt;reason&amp;gt;force-logout&amp;lt;/reason&amp;gt;&amp;lt;computer&amp;gt;" + computer1[j] + "&amp;lt;/computer&amp;gt;&amp;lt;/client-logout&amp;gt;&amp;lt;/global-protect-gateway&amp;gt;&amp;lt;/request&amp;gt;&amp;amp;key=" + api_key);&lt;BR /&gt;if (domain1[j] != "")&lt;BR /&gt;{&lt;BR /&gt;solicitud = System.Net.WebRequest.Create("https://" + ip_pa1 + "/api/?type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;global-protect-gateway&amp;gt;&amp;lt;client-logout&amp;gt;&amp;lt;gateway&amp;gt;" + pa_gw + "&amp;lt;/gateway&amp;gt;&amp;lt;domain&amp;gt;" + domain1[j] + "&amp;lt;/domain&amp;gt;&amp;lt;user&amp;gt;" + user1[j] + "&amp;lt;/user&amp;gt;&amp;lt;reason&amp;gt;force-logout&amp;lt;/reason&amp;gt;&amp;lt;computer&amp;gt;" + computer1[j] + "&amp;lt;/computer&amp;gt;&amp;lt;/client-logout&amp;gt;&amp;lt;/global-protect-gateway&amp;gt;&amp;lt;/request&amp;gt;&amp;amp;key=" + api_key);&lt;BR /&gt;}&lt;BR /&gt;Console.WriteLine(solicitud);&lt;BR /&gt;j++;&lt;BR /&gt;solicitud.ContentType = "application/json";&lt;BR /&gt;solicitud.Method = HttpMethod.Get.Method;&lt;/P&gt;&lt;P&gt;string respuesta = "";&lt;/P&gt;&lt;P&gt;using (StreamReader streamin = new StreamReader(solicitud.GetResponse().GetResponseStream()))&lt;BR /&gt;{&lt;BR /&gt;respuesta = streamin.ReadToEnd();&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;catch { }&lt;/P&gt;&lt;P&gt;System.Threading.Thread.Sleep(500);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2022 06:25:44 GMT</pubDate>
    <dc:creator>SoporteITS</dc:creator>
    <dc:date>2022-08-17T06:25:44Z</dc:date>
    <item>
      <title>Visual Basic script via API. How to add changes</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/visual-basic-script-via-api-how-to-add-changes/m-p/512076#M3096</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have configured a script in Visual Basic to disconnect all the GP VPN users logged but now I need to make an exception in order to not disconnect only one user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know how to code this exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After reading all the users logged in the firewall I make the following to disconnect them:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;j = 0;&lt;BR /&gt;while (user1[j] != null)&lt;BR /&gt;{&lt;BR /&gt;if (user1[j] != "")&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;&lt;BR /&gt;System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };&lt;BR /&gt;System.Net.WebRequest solicitud = System.Net.WebRequest.Create("https://" + ip_pa1 + "/api/?type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;global-protect-gateway&amp;gt;&amp;lt;client-logout&amp;gt;&amp;lt;gateway&amp;gt;" + pa_gw + "&amp;lt;/gateway&amp;gt;&amp;lt;user&amp;gt;" + user1[j] + "&amp;lt;/user&amp;gt;&amp;lt;reason&amp;gt;force-logout&amp;lt;/reason&amp;gt;&amp;lt;computer&amp;gt;" + computer1[j] + "&amp;lt;/computer&amp;gt;&amp;lt;/client-logout&amp;gt;&amp;lt;/global-protect-gateway&amp;gt;&amp;lt;/request&amp;gt;&amp;amp;key=" + api_key);&lt;BR /&gt;if (domain1[j] != "")&lt;BR /&gt;{&lt;BR /&gt;solicitud = System.Net.WebRequest.Create("https://" + ip_pa1 + "/api/?type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;global-protect-gateway&amp;gt;&amp;lt;client-logout&amp;gt;&amp;lt;gateway&amp;gt;" + pa_gw + "&amp;lt;/gateway&amp;gt;&amp;lt;domain&amp;gt;" + domain1[j] + "&amp;lt;/domain&amp;gt;&amp;lt;user&amp;gt;" + user1[j] + "&amp;lt;/user&amp;gt;&amp;lt;reason&amp;gt;force-logout&amp;lt;/reason&amp;gt;&amp;lt;computer&amp;gt;" + computer1[j] + "&amp;lt;/computer&amp;gt;&amp;lt;/client-logout&amp;gt;&amp;lt;/global-protect-gateway&amp;gt;&amp;lt;/request&amp;gt;&amp;amp;key=" + api_key);&lt;BR /&gt;}&lt;BR /&gt;Console.WriteLine(solicitud);&lt;BR /&gt;j++;&lt;BR /&gt;solicitud.ContentType = "application/json";&lt;BR /&gt;solicitud.Method = HttpMethod.Get.Method;&lt;/P&gt;&lt;P&gt;string respuesta = "";&lt;/P&gt;&lt;P&gt;using (StreamReader streamin = new StreamReader(solicitud.GetResponse().GetResponseStream()))&lt;BR /&gt;{&lt;BR /&gt;respuesta = streamin.ReadToEnd();&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;catch { }&lt;/P&gt;&lt;P&gt;System.Threading.Thread.Sleep(500);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 06:25:44 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/visual-basic-script-via-api-how-to-add-changes/m-p/512076#M3096</guid>
      <dc:creator>SoporteITS</dc:creator>
      <dc:date>2022-08-17T06:25:44Z</dc:date>
    </item>
  </channel>
</rss>

