<?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: Remote shutdown via CLI or through Panorama in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212605#M61983</link>
    <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/43480"&gt;@BPry&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp; I'd looked at the API but wasn't sure (this is not my area of any kind of expertise) how to use it.&lt;BR /&gt;&lt;BR /&gt;e.g. so how would I invoke those commands post login?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The entire shutdown for the DC is being driven through PowerShell and PowerCLI, so the commands to login, authenticate and&amp;nbsp;initiate shutdown have to be scripted for no manual intervention.&lt;BR /&gt;&lt;BR /&gt;Tim&lt;/P&gt;</description>
    <pubDate>Wed, 02 May 2018 14:14:23 GMT</pubDate>
    <dc:creator>timbiller</dc:creator>
    <dc:date>2018-05-02T14:14:23Z</dc:date>
    <item>
      <title>Remote shutdown via CLI or through Panorama</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212565#M61974</link>
      <description>&lt;P&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;I'm tasked with initiating a graceful shutdown of mutiple PA3060 firewalls following UPS-detected mains power loss via a scripted process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can login to invididual firewalls using plink but I can't work out how to enter the shutdown command with the confirming 'y' keystroke.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Does anyone have experience of this, please?&lt;BR /&gt;&lt;BR /&gt;We have Panorama in the environment, so alternatively, can this be achieved via ssh to the Panorama VM instance, which would then shutdown all managed firewall devices?&lt;BR /&gt;&lt;BR /&gt;Many thanks,&lt;BR /&gt;&lt;BR /&gt;Tim&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 10:24:03 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212565#M61974</guid>
      <dc:creator>timbiller</dc:creator>
      <dc:date>2018-05-02T10:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Remote shutdown via CLI or through Panorama</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212578#M61977</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/88816"&gt;@timbiller&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Not sure how you would do this with Plink, however it's easy enough to do with Netmiko. You could also issue this simply with the API with the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;/api/?type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;shutdown&amp;gt;&amp;lt;system&amp;gt;&amp;lt;/system&amp;gt;&amp;lt;/shutdown&amp;gt;&amp;lt;/request&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 13:08:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212578#M61977</guid>
      <dc:creator>BPry</dc:creator>
      <dc:date>2018-05-02T13:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Remote shutdown via CLI or through Panorama</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212605#M61983</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/43480"&gt;@BPry&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp; I'd looked at the API but wasn't sure (this is not my area of any kind of expertise) how to use it.&lt;BR /&gt;&lt;BR /&gt;e.g. so how would I invoke those commands post login?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The entire shutdown for the DC is being driven through PowerShell and PowerCLI, so the commands to login, authenticate and&amp;nbsp;initiate shutdown have to be scripted for no manual intervention.&lt;BR /&gt;&lt;BR /&gt;Tim&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 14:14:23 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212605#M61983</guid>
      <dc:creator>timbiller</dc:creator>
      <dc:date>2018-05-02T14:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Remote shutdown via CLI or through Panorama</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212626#M61985</link>
      <description>&lt;P&gt;With powershell, use invoke-restmethod, using the url&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;https://&amp;lt;FIREWALL_IP&amp;gt;/api/?type=op&amp;amp;key=&amp;lt;API_KEY&amp;gt;cmd=&amp;lt;request&amp;gt;&amp;lt;shutdown&amp;gt;&amp;lt;system&amp;gt;&amp;lt;/system&amp;gt;&amp;lt;/shutdown&amp;gt;&amp;lt;/request&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to obtain your API key, refer to this document:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.paloaltonetworks.com/documentation/71/pan-os/xml-api/get-started-with-the-pan-os-xml-api/get-your-api-key" target="_blank"&gt;https://www.paloaltonetworks.com/documentation/71/pan-os/xml-api/get-started-with-the-pan-os-xml-api/get-your-api-key&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recommend using a service account for this obviously, and storing the api key as if it were a password&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: I believe invoke-restmethod is only available in PS 3.0 and later, so windows 7 and server 2012 wil not have it unless powershell was upgraded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 14:33:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212626#M61985</guid>
      <dc:creator>JoeAndreini</dc:creator>
      <dc:date>2018-05-02T14:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Remote shutdown via CLI or through Panorama</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212627#M61986</link>
      <description>&lt;P&gt;The API is pretty easy to utilize, just generate your API key and you're ready to go.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for the scripting side of things, you can actually do this perfectly fine in powershell and just include it in the same script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can configure something like this to get this to work properly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Sysem.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12&lt;/P&gt;&lt;P&gt;$wc = New-Object System.Net.WebClient.DownloadString&lt;/P&gt;&lt;P&gt;$wc("https://&lt;EM&gt;firewall&lt;/EM&gt;/api/?type=ip&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;shutdown&amp;gt;&amp;lt;system&amp;gt;&amp;lt;/system&amp;gt;&amp;lt;/shutdown&amp;gt;&amp;lt;/request&amp;gt;&amp;amp;key=&lt;EM&gt;apikey&lt;/EM&gt;")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a note on actually issueing the shutdown command however; are you sure that you actually want to do this? If the power is restored to the UPS before the battery runs out the firewall will actually need to be unplugged and plugged back in to power back on.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 14:32:06 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212627#M61986</guid>
      <dc:creator>BPry</dc:creator>
      <dc:date>2018-05-02T14:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Remote shutdown via CLI or through Panorama</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212865#M62013</link>
      <description>&lt;P&gt;Thanks again.&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/43480"&gt;@BPry&lt;/a&gt;&amp;nbsp;Yes, I'm absolutely sure I want to do this. There's no issue with the manual/disconnect reconnect action post shutdown. That's been taken into consideration as part of the overall design.&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 07:44:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212865#M62013</guid>
      <dc:creator>timbiller</dc:creator>
      <dc:date>2018-05-03T07:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Remote shutdown via CLI or through Panorama</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212950#M62025</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/88816"&gt;@timbiller&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Just wanted to make sure you knew that bit. I've had some people get mad because they didn't realize that shutdown and restart didn't function the same. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 13:24:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/remote-shutdown-via-cli-or-through-panorama/m-p/212950#M62025</guid>
      <dc:creator>BPry</dc:creator>
      <dc:date>2018-05-03T13:24:51Z</dc:date>
    </item>
  </channel>
</rss>

