Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for more than one Bitlocker key per volume #8

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

brianreidc7
Copy link
Contributor

I was finding that the script would enumerate more than one $KeyProtectorId and then fail to write to Entra ID (BackupToAAD-...) as the value was an array and not a single GUID.

This update loops for each $KeyProtectorId and writes each one to Entra ID. Failing script if any one of the attempts fails. Script succeeds if ALL keys are uploaded

I was finding that the script would enumerate more than one $KeyProtectorId and then fail to write to Entra ID (BackupToAAD-...) as the value was an array and not a single GUID.

This update loops for each $KeyProtectorId and writes each one to Entra ID. Failing script if any one of the attempts fails. Script succeeds if ALL keys are uploaded
foreach ($Key in $BitlockerKey) {

try {
BackupToAAD-BitLockerKeyProtector -MountPoint $BitlockerDrive -KeyProtectorId $Key #-ErrorAction SilentlyContinue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add -ErrorAction Stop to make sure the catch kicks in.

@baardhermansen
Copy link
Contributor

@brianreidc7 Doesn't this PR then fix #7?

Copy link
Owner

@mardahl mardahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. I have no life at the moment because if high workload. So, I can't test.

@mardahl mardahl merged commit 0ddf04c into mardahl:master Nov 7, 2023
@baardhermansen
Copy link
Contributor

Hi Michael @mardahl
Just a tip: If you add

Close #7

when approving a merge (PR), the corresponding issue will be closed and linked to this PR :)

@mardahl
Copy link
Owner

mardahl commented Nov 8, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants