{"id":251,"date":"2019-06-03T14:03:58","date_gmt":"2019-06-03T06:03:58","guid":{"rendered":"https:\/\/www.theinsecurewire.com\/?p=251"},"modified":"2019-06-03T14:03:58","modified_gmt":"2019-06-03T06:03:58","slug":"palo-alto-networks-powershell-backup-script","status":"publish","type":"post","link":"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/","title":{"rendered":"Palo Alto Networks Powershell Backup Script"},"content":{"rendered":"<p>As we recently rolled out a bunch of PA firewalls, I have created a powershell script to backup the running configuration using the XML API.<\/p>\n<p>You can grab the script from my github here:<br \/>\n<a href=\"https:\/\/github.com\/nikonau\/panbackup\" rel=\"noopener noreferrer\" target=\"_blank\">panbackup<\/a><\/p>\n<p>The instructions are as follows:<br \/>\n1. Create the folder c:\\panbackup\\ on your Windows Server.<\/p>\n<p>2. Create a local administrator on the firewall as a member of super users (read only). This will allow rights to export the full configuration with phash keys. Which means you can restore the config on a new appliance easily. The below PA documentation details how to create a local firewall administrator: <a href=\"https:\/\/docs.paloaltonetworks.com\/pan-os\/9-0\/pan-os-admin\/firewall-administration\/manage-firewall-administrators\/configure-administrative-accounts-and-authentication\/configure-a-firewall-administrator-account.html\" rel=\"noopener noreferrer\" target=\"_blank\">Create Firewall Administrator<\/a><\/p>\n<p>3. Generate your API key as follows: https:\/\/\/api\/?type=keygen&#038;user=&#038;password= You can also generate api key via cURL as per the PA documentation below:<br \/>\n<a href=\"https:\/\/docs.paloaltonetworks.com\/pan-os\/9-0\/pan-os-panorama-api\/get-started-with-the-pan-os-xml-api\/get-your-api-key.html\" rel=\"noopener noreferrer\" target=\"_blank\">Generate your API key<\/a><\/p>\n<p>4. Test your powershell script! You may need to set the correct saving path, file names etc. Add a scheduled task and viola! Peace of mind.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As we recently rolled out a bunch of PA firewalls, I have created a powershell script to backup the running configuration using the XML API&#8230;.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-251","post","type-post","status-publish","format-standard","hentry","category-firewall"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Palo Alto Networks Powershell Backup Script - Insecure Wire<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Palo Alto Networks Powershell Backup Script - Insecure Wire\" \/>\n<meta property=\"og:description\" content=\"As we recently rolled out a bunch of PA firewalls, I have created a powershell script to backup the running configuration using the XML API....\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/\" \/>\n<meta property=\"og:site_name\" content=\"Insecure Wire\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-03T06:03:58+00:00\" \/>\n<meta name=\"author\" content=\"nikonau\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/insecurewire\" \/>\n<meta name=\"twitter:site\" content=\"@insecurewire\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"nikonau\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/\"},\"author\":{\"name\":\"nikonau\",\"@id\":\"https:\/\/www.insecurewi.re\/#\/schema\/person\/8ba08b41fc754b971a948ead6ccb777d\"},\"headline\":\"Palo Alto Networks Powershell Backup Script\",\"datePublished\":\"2019-06-03T06:03:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/\"},\"wordCount\":164,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.insecurewi.re\/#organization\"},\"articleSection\":[\"Firewall\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/\",\"url\":\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/\",\"name\":\"Palo Alto Networks Powershell Backup Script - Insecure Wire\",\"isPartOf\":{\"@id\":\"https:\/\/www.insecurewi.re\/#website\"},\"datePublished\":\"2019-06-03T06:03:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.insecurewi.re\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Palo Alto Networks Powershell Backup Script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.insecurewi.re\/#website\",\"url\":\"https:\/\/www.insecurewi.re\/\",\"name\":\"Insecure Wire\",\"description\":\"A Network Engineer\u2019s Perspective.\",\"publisher\":{\"@id\":\"https:\/\/www.insecurewi.re\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.insecurewi.re\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.insecurewi.re\/#organization\",\"name\":\"Insecure Wire\",\"url\":\"https:\/\/www.insecurewi.re\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.insecurewi.re\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.insecurewi.re\/wp-content\/uploads\/2023\/10\/cloud.png\",\"contentUrl\":\"https:\/\/www.insecurewi.re\/wp-content\/uploads\/2023\/10\/cloud.png\",\"width\":32,\"height\":32,\"caption\":\"Insecure Wire\"},\"image\":{\"@id\":\"https:\/\/www.insecurewi.re\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/insecurewire\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.insecurewi.re\/#\/schema\/person\/8ba08b41fc754b971a948ead6ccb777d\",\"name\":\"nikonau\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.insecurewi.re\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2d1b9d9dc90da4f6d3da31b870f418c6b3553ba9be48d53e8ee3a35b0adb1d35?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2d1b9d9dc90da4f6d3da31b870f418c6b3553ba9be48d53e8ee3a35b0adb1d35?s=96&d=mm&r=g\",\"caption\":\"nikonau\"},\"sameAs\":[\"https:\/\/x.com\/https:\/\/twitter.com\/insecurewire\"],\"url\":\"https:\/\/www.insecurewi.re\/index.php\/author\/nikon\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Palo Alto Networks Powershell Backup Script - Insecure Wire","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/","og_locale":"en_US","og_type":"article","og_title":"Palo Alto Networks Powershell Backup Script - Insecure Wire","og_description":"As we recently rolled out a bunch of PA firewalls, I have created a powershell script to backup the running configuration using the XML API....","og_url":"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/","og_site_name":"Insecure Wire","article_published_time":"2019-06-03T06:03:58+00:00","author":"nikonau","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/insecurewire","twitter_site":"@insecurewire","twitter_misc":{"Written by":"nikonau","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/#article","isPartOf":{"@id":"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/"},"author":{"name":"nikonau","@id":"https:\/\/www.insecurewi.re\/#\/schema\/person\/8ba08b41fc754b971a948ead6ccb777d"},"headline":"Palo Alto Networks Powershell Backup Script","datePublished":"2019-06-03T06:03:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/"},"wordCount":164,"commentCount":0,"publisher":{"@id":"https:\/\/www.insecurewi.re\/#organization"},"articleSection":["Firewall"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/","url":"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/","name":"Palo Alto Networks Powershell Backup Script - Insecure Wire","isPartOf":{"@id":"https:\/\/www.insecurewi.re\/#website"},"datePublished":"2019-06-03T06:03:58+00:00","breadcrumb":{"@id":"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.insecurewi.re\/index.php\/2019\/06\/03\/palo-alto-networks-powershell-backup-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.insecurewi.re\/"},{"@type":"ListItem","position":2,"name":"Palo Alto Networks Powershell Backup Script"}]},{"@type":"WebSite","@id":"https:\/\/www.insecurewi.re\/#website","url":"https:\/\/www.insecurewi.re\/","name":"Insecure Wire","description":"A Network Engineer\u2019s Perspective.","publisher":{"@id":"https:\/\/www.insecurewi.re\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.insecurewi.re\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.insecurewi.re\/#organization","name":"Insecure Wire","url":"https:\/\/www.insecurewi.re\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.insecurewi.re\/#\/schema\/logo\/image\/","url":"https:\/\/www.insecurewi.re\/wp-content\/uploads\/2023\/10\/cloud.png","contentUrl":"https:\/\/www.insecurewi.re\/wp-content\/uploads\/2023\/10\/cloud.png","width":32,"height":32,"caption":"Insecure Wire"},"image":{"@id":"https:\/\/www.insecurewi.re\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/insecurewire"]},{"@type":"Person","@id":"https:\/\/www.insecurewi.re\/#\/schema\/person\/8ba08b41fc754b971a948ead6ccb777d","name":"nikonau","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.insecurewi.re\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2d1b9d9dc90da4f6d3da31b870f418c6b3553ba9be48d53e8ee3a35b0adb1d35?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2d1b9d9dc90da4f6d3da31b870f418c6b3553ba9be48d53e8ee3a35b0adb1d35?s=96&d=mm&r=g","caption":"nikonau"},"sameAs":["https:\/\/x.com\/https:\/\/twitter.com\/insecurewire"],"url":"https:\/\/www.insecurewi.re\/index.php\/author\/nikon\/"}]}},"_links":{"self":[{"href":"https:\/\/www.insecurewi.re\/index.php\/wp-json\/wp\/v2\/posts\/251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.insecurewi.re\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.insecurewi.re\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.insecurewi.re\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.insecurewi.re\/index.php\/wp-json\/wp\/v2\/comments?post=251"}],"version-history":[{"count":0,"href":"https:\/\/www.insecurewi.re\/index.php\/wp-json\/wp\/v2\/posts\/251\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.insecurewi.re\/index.php\/wp-json\/wp\/v2\/media?parent=251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.insecurewi.re\/index.php\/wp-json\/wp\/v2\/categories?post=251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.insecurewi.re\/index.php\/wp-json\/wp\/v2\/tags?post=251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}