Skip to content

Instantly share code, notes, and snippets.

@kewalaka
Created March 15, 2021 22:05
Show Gist options
  • Select an option

  • Save kewalaka/143eee3fba467f107077ec66e0f19650 to your computer and use it in GitHub Desktop.

Select an option

Save kewalaka/143eee3fba467f107077ec66e0f19650 to your computer and use it in GitHub Desktop.
Bitlocker - Update the password stored in AD for the local C: drive
$id = (manage-bde -protectors -get c: | select-string 'Numerical Password' -context 1 |select -expandproperty context).Postcontext
if ($id.Length -eq 1)
{
$trimmedId = $id[0].Substring($id[0].IndexOf("{"))
Write-Host "Setting ID $trimmedId for computer $($env:COMPUTERNAME)"
manage-bde -protectors -adbackup c: -id $trimmedId
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment