Created
March 15, 2021 22:05
-
-
Save kewalaka/143eee3fba467f107077ec66e0f19650 to your computer and use it in GitHub Desktop.
Bitlocker - Update the password stored in AD for the local C: drive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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