Skip to content

Instantly share code, notes, and snippets.

@keithga
Last active February 9, 2018 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithga/bb0df90123ce61b351f0321345765cb6 to your computer and use it in GitHub Desktop.
Save keithga/bb0df90123ce61b351f0321345765cb6 to your computer and use it in GitHub Desktop.
Wait for Checkpoint Transition
<#
.SYNOPSIS
Monitor Progress for CheckPoint Encryption or Decryption
.DESCRIPTION
This script is designed to Block the task sequence from continuing if Checkpoint
is in the Encrypting or Decrypting phase. Additionally will display a visual
progress percentage using the existing SMS Task Sequencing UI framework.
.NOTES
Apache License 2.0
#>
[cmdletbinding()]
param()
write-host "Start CheckPoint Progress script for MDT/SCCM"
$TSENV = New-Object -COMObject Microsoft.SMS.TSEnvironment
$Progress = New-Object -COMObject Microsoft.SMS.TSProgressUI
$CheckPointReg = 'HKLM:\SOFTWARE\WOW6432Node\CheckPoint\EndPoint Security\Full Disk Encryption\Status\Current Boot'
$OrgName = $tsenv.Value('_SMSTSOrgName')
$PackageName = $tsenv.Value('_SMSTSPackageName')
$ProgressMsg = $tsenv.Value('_SMSTSCustomProgressDialogMessage')
$actionName = $tsenv.Value('_SMSTSCurrentActionName')
$OrgName = $tsenv.Value('_SMSTSOrgName')
$ProgressStep = $tsenv.Value('_SMSTSNextInstructionPointer')
$ProgressMaxStep = $tsenv.Value('_SMSTSInstructionTableSize')
$LastStatus = $null
$StatusDirty = $False
$Status = Get-ItemProperty $CheckPointReg
$status | out-string -Width 200| write-host
while ( $Status.clientStatus -eq '50' -or $Status.ClientStatus -eq '60' ) {
$StatusDirty = $true
if ( ([int]$Status.clientStatusDetails) -ne $LastStatus ) {
$LastStatus = $Status.clientStatusDetails -as [int]
$TheProgress = "Progress $($LastStatus)% ..."
write-host $TheProgress
$Progress.ShowActionProgress($OrgName,$PackageName,$ProgressMsg,$actionName,$ProgressStep,$ProgressMaxStep,$TheProgress,$LastStatus,100)
}
$Status = Get-ItemProperty $CheckPointReg
}
if ($StatusDirty) {
$progress.ShowTSProgress($OrgName,$PackageName,$ProgressMsg,$actionName,$ProgressStep,$ProgressMaxStep)
}
$status | out-string -Width 200| write-host
write-host "Finished CheckPoint Progress script for MDT/SCCM"
@4techyguy
Copy link

Hi,
I wanted to use the above script to include in the TS. I have added a powershell script command entry at the very bottom of the TS but it doesn't show any display during the TS and ends the TS. What am I missing?

Thanks,
Paul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment