HP Sure Recover User Guide

4 Working with the HP Client Management
Script Library (CMSL)
The HP Client Management Script Library allows you to manage HP Sure Recover settings with PowerShell.
The following example script demonstrates how to provision, determine status, change conīž­guration, and
deprovision HP Sure Recover.
NOTE: Several of the commands exceed the line length of this guide but must be entered as a single line.
$ErrorActionPreference = "Stop"
$path = 'C:\test_keys'
$ekpw = ""
$skpw = ""
Get-HPSecurePlatformState
try {
Write-host 'Provisioning Endorsement Key'
$p = New-HPSecurePlatformEndorsementKeyProvisioningPayload `
-EndorsementKeyPassword $ekpw `
-EndorsementKeyFile "$path\kek.pfx"
$p | Set-HPSecurePLatformPayload
Start-Sleep -Seconds 3
Write-host 'Provisioning signing key'
$p = New-HPSecurePlatformSigningKeyProvisioningPayload `
-EndorsementKeyPassword $ekpw `
-EndorsementKeyFile "$path\kek.pfx" `
-SigningKeyFile "$path\sk.pfx"
$p | Set-HPSecurePLatformPayload
$p = New-HPSureRecoverImageConfigurationPayload `
12 Chapter 4 Working with the HP Client Management Script Library (CMSL)