{"id":5372,"date":"2021-08-04T23:52:09","date_gmt":"2021-08-04T23:52:09","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=5372"},"modified":"2021-11-04T23:53:16","modified_gmt":"2021-11-04T23:53:16","slug":"thales-cipher-trust-manager-backup-script-via-powershell-and-api","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api","title":{"rendered":"Thales Cipher Trust Manager Backup Script via Powershell and API"},"content":{"rendered":"<p># KeySecure API endpoint and POST params<br aria-hidden=\"true\" \/>$keysecures = @(&#8220;%KeysecureIPorDNS%&#8221;)<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>#Import Credentials from Credential XML, this is protected by file level application for security Format &lt;Credentials&gt;&lt;Credential&gt;&lt;Name\\User\\Password&gt;keysecure&lt;\/Name\\User\\Password&gt;&lt;\/Credential&gt;&lt;\/Credentials&gt;<br aria-hidden=\"true\" \/>$credxml = Select-Xml -Path \u00a0&#8220;\\\\sydfileserver\\shared\\Security\\Project 2020 &#8211; Huon\\CLI\\Credentials.xml&#8221; -XPath &#8216;\/Credentials\/Credential&#8217; | Select-Object -ExpandProperty Node<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>#import credentials from XML into values to be used<br aria-hidden=\"true\" \/>$kscreds = $credxml | Where-Object {$_.Name -eq &#8220;keysecure&#8221;}<br aria-hidden=\"true\" \/>$pscpcreds = $credxml | Where-Object {$_.Name -eq &#8220;pscp&#8221;}<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>#change ks creds for Json<br aria-hidden=\"true\" \/>$kscreds = @{ username = $kscreds.User; password = $kscreds.Password; }<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>#look through all KeySecures and do<br aria-hidden=\"true\" \/>foreach ($keysecure in $keysecures) {<br aria-hidden=\"true\" \/>\u00a0 \u00a0 #Output current Keysecure<br aria-hidden=\"true\" \/>\u00a0 \u00a0 $keysecure<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 # Make API request to get bearer token valid for 300 Seconds<br aria-hidden=\"true\" \/>\u00a0 \u00a0 $bearer_token = Invoke-WebRequest https:\/\/$keysecure\/api\/v1\/auth\/tokens -Method Post -Body $kscreds -UseBasicParsing | ConvertFrom-Json<br aria-hidden=\"true\" \/>\u00a0 \u00a0 $bearer_token = $bearer_token.jwt<br aria-hidden=\"true\" \/>\u00a0 \u00a0 #Build Header with Bearer Token for Future Requests<br aria-hidden=\"true\" \/>\u00a0 \u00a0 $headers = @{Authorization = &#8220;Bearer $bearer_token&#8221;}<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 #Create Backup<br aria-hidden=\"true\" \/>\u00a0 \u00a0 $params = @{ tiedToHSM = &#8220;false&#8221;; scope = &#8220;&#8221;; backupKey =&#8221;&#8221;; }<br aria-hidden=\"true\" \/>\u00a0 \u00a0 $response = Invoke-RestMethod -Uri https:\/\/$keysecure\/api\/v1\/backups -Method Post -Headers $headers \u00a0-Body $params -UseBasicParsing<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 #Output Backup ID for Fault Finding<br aria-hidden=\"true\" \/>\u00a0 \u00a0 $<a href=\"https:\/\/protect-au.mimecast.com\/s\/BFBRCxnMPBh28o2I8DP1q?domain=response.id\" target=\"_blank\" rel=\"noopener noreferrer\" data-auth=\"NotApplicable\" data-linkindex=\"2\">response.id<\/a><br aria-hidden=\"true\" \/>\u00a0 \u00a0 $response = $<a href=\"https:\/\/protect-au.mimecast.com\/s\/BFBRCxnMPBh28o2I8DP1q?domain=response.id\" target=\"_blank\" rel=\"noopener noreferrer\" data-auth=\"NotApplicable\" data-linkindex=\"3\">response.id<\/a><br aria-hidden=\"true\" \/>\u00a0 \u00a0 #While look to check Backup status then download and delete backup once completed<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 #12 tries 5 Seconds each<br aria-hidden=\"true\" \/>\u00a0 \u00a0 $maxRetries = 12; $retryCount = 0; $completed = $false<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 #Check for Loop to complete<br aria-hidden=\"true\" \/>\u00a0 \u00a0 while (-not $completed) {<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 #Get Backup Status<br aria-hidden=\"true\" \/>\u00a0 \u00a0 $bkstaus = Invoke-RestMethod -Uri https:\/\/$keysecure\/api\/v1\/backupStatus -Method get -Headers $headers -UseBasicParsing;<br aria-hidden=\"true\" \/>\u00a0 \u00a0 #Output Backup Status for Fault Finding<br aria-hidden=\"true\" \/>\u00a0 \u00a0 $bkstaus.status<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 if ($bkstaus.status -eq &#8220;Completed&#8221;){<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $completed = $true<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #download File<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Invoke-RestMethod -Uri https:\/\/$keysecure\/api\/v1\/backups\/$response\/download -Method get -Headers $headers -OutFile &#8220;C:\\Temp\\$keysecure$response.bak&#8221;<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #move to SCP NFS\u00a0<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #check File Exists<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 IF (Test-Path C:\\Temp\\$keysecure$response.bak) {<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #Check not 0KB<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 If ((Get-Item C:\\Temp\\$keysecure$response.bak).length -gt 0kb) {<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#delete File from KeySecure<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Invoke-RestMethod -Uri https:\/\/$keysecure\/api\/v1\/backups\/$response -Method delete -Headers $headers \u00a0-Body $params -UseBasicParsing<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0$body += $keysecure+&#8217; backed up using &#8216; + $response + &#8221; id&lt;br&gt;&#8221;<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0else { $body += &#8220;Error&#8221; + $keysecure+$response + \u00a0&#8221; File 0kb&lt;br&gt;&#8221; }<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0else { $body += &#8220;Error&#8221; + $keysecure+$response + \u00a0&#8221; Backup file does not exist&lt;br&gt;&#8221; }<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 }<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 else {<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0if ($retryCount -ge $maxRetries) {<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#output error for retries waiting for backup to complete<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0$body += &#8220;Error&#8221; + $keysecure+$response+ &#8216;Max retries exceeded wating for backup&lt;br&gt;&#8217;<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 } else {<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #wait 5 seconds and try again<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Start-Sleep -Seconds &#8216;5&#8217;<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $retryCount++<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<br aria-hidden=\"true\" \/>\u00a0 \u00a0 \u00a0 \u00a0 }<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>\u00a0 \u00a0 }<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>}<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>#email out<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>$EmailFrom = %FROMEMAIL%&#8221;;<br aria-hidden=\"true\" \/>$EmailTo = &#8221; %TOEMAIL%\u00a0 &#8220;;<br aria-hidden=\"true\" \/>#Note: Use comma separated list if more than one CC email address below:<br aria-hidden=\"true\" \/>$EmailCopies = &#8221; %TOEMAIL% &#8220;;\u00a0<br aria-hidden=\"true\" \/>if($Body -like &#8216;*Error*&#8217;) {$Subject= &#8216;Keysecure Backup Error&#8217;} Else { $Subject = &#8216;Keysecure Backup Success&#8217;} ;<br aria-hidden=\"true\" \/>$Body = $body;<br aria-hidden=\"true\" \/>$mailMessage = New-Object Net.Mail.MailMessage($EmailFrom, $EmailTo, $Subject, $Body);<br aria-hidden=\"true\" \/>foreach ($addr in $EmailCopies.split(&#8216;,&#8217;)) {<br aria-hidden=\"true\" \/>$mailMessage.CC.Add($addr );<br aria-hidden=\"true\" \/>}<br aria-hidden=\"true\" \/>$mailMessage.IsBodyHtml = $true;<br aria-hidden=\"true\" \/>$SMTPServer = &#8220;%SMTP%&#8221;;<br aria-hidden=\"true\" \/># Make Windows negotiate higher TLS version:<br aria-hidden=\"true\" \/>[System.Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;<br aria-hidden=\"true\" \/>$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer);<br aria-hidden=\"true\" \/>$SMTPClient.EnableSsl = $true;<br aria-hidden=\"true\" \/>$SMTPClient.Send($mailMessage);<\/p>","protected":false},"excerpt":{"rendered":"<p># KeySecure API endpoint and POST params$keysecures = @(&#8220;%KeysecureIPorDNS%&#8221;)#Import Credentials from Credential XML, this is protected by file level application for security Format &lt;Credentials&gt;&lt;Credential&gt;&lt;Name\\User\\Password&gt;keysecure&lt;\/Name\\User\\Password&gt;&lt;\/Credential&gt;&lt;\/Credentials&gt;$credxml = Select-Xml -Path [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5372","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"# KeySecure API endpoint and POST params$keysecures = @(&quot;%KeysecureIPorDNS%&quot;)#Import Credentials from Credential XML, this is protected by file level application for security Format keysecure$credxml = Select-Xml -Path &quot;\\sydfileserver\\shared\\Security\\Project 2020 - Huon\\CLI\\Credentials.xml&quot; -XPath &#039;\/Credentials\/Credential&#039; | Select-Object -ExpandProperty Node#import credentials from XML into values to be used$kscreds = $credxml | Where-Object {$_.Name -eq &quot;keysecure&quot;}$pscpcreds = $credxml |\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"paris\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Welcome to Pariswells.com |\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Thales Cipher Trust Manager Backup Script via Powershell and API | Welcome to Pariswells.com\" \/>\n\t\t<meta property=\"og:description\" content=\"# KeySecure API endpoint and POST params$keysecures = @(&quot;%KeysecureIPorDNS%&quot;)#Import Credentials from Credential XML, this is protected by file level application for security Format keysecure$credxml = Select-Xml -Path &quot;\\sydfileserver\\shared\\Security\\Project 2020 - Huon\\CLI\\Credentials.xml&quot; -XPath &#039;\/Credentials\/Credential&#039; | Select-Object -ExpandProperty Node#import credentials from XML into values to be used$kscreds = $credxml | Where-Object {$_.Name -eq &quot;keysecure&quot;}$pscpcreds = $credxml |\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2021-08-04T23:52:09+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2021-11-04T23:53:16+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Thales Cipher Trust Manager Backup Script via Powershell and API | Welcome to Pariswells.com\" \/>\n\t\t<meta name=\"twitter:description\" content=\"# KeySecure API endpoint and POST params$keysecures = @(&quot;%KeysecureIPorDNS%&quot;)#Import Credentials from Credential XML, this is protected by file level application for security Format keysecure$credxml = Select-Xml -Path &quot;\\sydfileserver\\shared\\Security\\Project 2020 - Huon\\CLI\\Credentials.xml&quot; -XPath &#039;\/Credentials\/Credential&#039; | Select-Object -ExpandProperty Node#import credentials from XML into values to be used$kscreds = $credxml | Where-Object {$_.Name -eq &quot;keysecure&quot;}$pscpcreds = $credxml |\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#article\",\"name\":\"Thales Cipher Trust Manager Backup Script via Powershell and API | Welcome to Pariswells.com\",\"headline\":\"Thales Cipher Trust Manager Backup Script via Powershell and API\",\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"},\"datePublished\":\"2021-08-04T23:52:09+00:00\",\"dateModified\":\"2021-11-04T23:53:16+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#webpage\"},\"articleSection\":\"Research\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pariswells.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"name\":\"Research\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"position\":2,\"name\":\"Research\",\"item\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#listItem\",\"name\":\"Thales Cipher Trust Manager Backup Script via Powershell and API\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#listItem\",\"position\":3,\"name\":\"Thales Cipher Trust Manager Backup Script via Powershell and API\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"name\":\"Research\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\",\"name\":\"Welcome to Pariswells.com\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris\",\"name\":\"paris\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93b8ee3f592ac401167f870452bd82d43de80152cd3524e2853403658ada9984?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"paris\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#webpage\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/thales-cipher-trust-manager-backup-script-via-powershell-and-api\",\"name\":\"Thales Cipher Trust Manager Backup Script via Powershell and API | Welcome to Pariswells.com\",\"description\":\"# KeySecure API endpoint and POST params$keysecures = @(\\\"%KeysecureIPorDNS%\\\")#Import Credentials from Credential XML, this is protected by file level application for security Format keysecure$credxml = Select-Xml -Path \\\"\\\\sydfileserver\\\\shared\\\\Security\\\\Project 2020 - Huon\\\\CLI\\\\Credentials.xml\\\" -XPath '\\\/Credentials\\\/Credential' | Select-Object -ExpandProperty Node#import credentials from XML into values to be used$kscreds = $credxml | Where-Object {$_.Name -eq \\\"keysecure\\\"}$pscpcreds = $credxml |\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"datePublished\":\"2021-08-04T23:52:09+00:00\",\"dateModified\":\"2021-11-04T23:53:16+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/\",\"name\":\"Welcome to Pariswells.com\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Thales Cipher Trust Manager Backup Script via Powershell and API | Welcome to Pariswells.com","description":"# KeySecure API endpoint and POST params$keysecures = @(\"%KeysecureIPorDNS%\")#Import Credentials from Credential XML, this is protected by file level application for security Format keysecure$credxml = Select-Xml -Path \"\\sydfileserver\\shared\\Security\\Project 2020 - Huon\\CLI\\Credentials.xml\" -XPath '\/Credentials\/Credential' | Select-Object -ExpandProperty Node#import credentials from XML into values to be used$kscreds = $credxml | Where-Object {$_.Name -eq \"keysecure\"}$pscpcreds = $credxml |","canonical_url":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#article","name":"Thales Cipher Trust Manager Backup Script via Powershell and API | Welcome to Pariswells.com","headline":"Thales Cipher Trust Manager Backup Script via Powershell and API","author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"},"datePublished":"2021-08-04T23:52:09+00:00","dateModified":"2021-11-04T23:53:16+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#webpage"},"isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#webpage"},"articleSection":"Research"},{"@type":"BreadcrumbList","@id":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/pariswells.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","name":"Research"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","position":2,"name":"Research","item":"https:\/\/pariswells.com\/blog\/category\/research","nextItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#listItem","name":"Thales Cipher Trust Manager Backup Script via Powershell and API"},"previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#listItem","position":3,"name":"Thales Cipher Trust Manager Backup Script via Powershell and API","previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","name":"Research"}}]},{"@type":"Organization","@id":"https:\/\/pariswells.com\/blog\/#organization","name":"Welcome to Pariswells.com","url":"https:\/\/pariswells.com\/blog\/"},{"@type":"Person","@id":"https:\/\/pariswells.com\/blog\/author\/paris#author","url":"https:\/\/pariswells.com\/blog\/author\/paris","name":"paris","image":{"@type":"ImageObject","@id":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/93b8ee3f592ac401167f870452bd82d43de80152cd3524e2853403658ada9984?s=96&d=mm&r=g","width":96,"height":96,"caption":"paris"}},{"@type":"WebPage","@id":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#webpage","url":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api","name":"Thales Cipher Trust Manager Backup Script via Powershell and API | Welcome to Pariswells.com","description":"# KeySecure API endpoint and POST params$keysecures = @(\"%KeysecureIPorDNS%\")#Import Credentials from Credential XML, this is protected by file level application for security Format keysecure$credxml = Select-Xml -Path \"\\sydfileserver\\shared\\Security\\Project 2020 - Huon\\CLI\\Credentials.xml\" -XPath '\/Credentials\/Credential' | Select-Object -ExpandProperty Node#import credentials from XML into values to be used$kscreds = $credxml | Where-Object {$_.Name -eq \"keysecure\"}$pscpcreds = $credxml |","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api#breadcrumblist"},"author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"creator":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"datePublished":"2021-08-04T23:52:09+00:00","dateModified":"2021-11-04T23:53:16+00:00"},{"@type":"WebSite","@id":"https:\/\/pariswells.com\/blog\/#website","url":"https:\/\/pariswells.com\/blog\/","name":"Welcome to Pariswells.com","inLanguage":"en-US","publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Welcome to Pariswells.com |","og:type":"article","og:title":"Thales Cipher Trust Manager Backup Script via Powershell and API | Welcome to Pariswells.com","og:description":"# KeySecure API endpoint and POST params$keysecures = @(&quot;%KeysecureIPorDNS%&quot;)#Import Credentials from Credential XML, this is protected by file level application for security Format keysecure$credxml = Select-Xml -Path &quot;\\sydfileserver\\shared\\Security\\Project 2020 - Huon\\CLI\\Credentials.xml&quot; -XPath '\/Credentials\/Credential' | Select-Object -ExpandProperty Node#import credentials from XML into values to be used$kscreds = $credxml | Where-Object {$_.Name -eq &quot;keysecure&quot;}$pscpcreds = $credxml |","og:url":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api","article:published_time":"2021-08-04T23:52:09+00:00","article:modified_time":"2021-11-04T23:53:16+00:00","twitter:card":"summary","twitter:title":"Thales Cipher Trust Manager Backup Script via Powershell and API | Welcome to Pariswells.com","twitter:description":"# KeySecure API endpoint and POST params$keysecures = @(&quot;%KeysecureIPorDNS%&quot;)#Import Credentials from Credential XML, this is protected by file level application for security Format keysecure$credxml = Select-Xml -Path &quot;\\sydfileserver\\shared\\Security\\Project 2020 - Huon\\CLI\\Credentials.xml&quot; -XPath '\/Credentials\/Credential' | Select-Object -ExpandProperty Node#import credentials from XML into values to be used$kscreds = $credxml | Where-Object {$_.Name -eq &quot;keysecure&quot;}$pscpcreds = $credxml |"},"aioseo_meta_data":{"post_id":"5372","title":null,"description":null,"keywords":[],"keyphrases":{"focus":[],"additional":[]},"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-11-04 23:52:09","updated":"2022-09-14 05:43:54","primary_term":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/pariswells.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/pariswells.com\/blog\/category\/research\" title=\"Research\">Research<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tThales Cipher Trust Manager Backup Script via Powershell and API\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/pariswells.com\/blog"},{"label":"Research","link":"https:\/\/pariswells.com\/blog\/category\/research"},{"label":"Thales Cipher Trust Manager Backup Script via Powershell and API","link":"https:\/\/pariswells.com\/blog\/research\/thales-cipher-trust-manager-backup-script-via-powershell-and-api"}],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/5372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=5372"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/5372\/revisions"}],"predecessor-version":[{"id":5373,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/5372\/revisions\/5373"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=5372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=5372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=5372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}