HP EliteBook 745 Sure Recover User Guide - Page 18

Working with the HP Client Management Script Library (CMSL

Page 18 highlights

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 configuration, 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)

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

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
configuration,
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)