PowerShell script exchange
Post Reply
ipro-bgardner
Novice
Posts: 6
Liked: 2 times
Joined: May 07, 2021 4:43 pm
Full Name: Brent Gardner
Contact:

Get encryption key for specific job

Post by ipro-bgardner »

Trying to audit encryption settings on our backup and offsite-copy jobs.
Sadly, looks like there's no Get-VBRJobAdvancedStorageOptions cmdlet.
How can I determine which encryption key is being used by a specific job?
I'd rather not have to click through tens of jobs to get this from the GUI.
Of course, I'm not looking for the actual secure string. But if I could get the ID then I could cross-reference with output from Get-VBREncryptionKey to get the human-meaningful description.

Regards,

oleg.feoktistov
Veeam Software
Posts: 1006
Liked: 364 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get encryption key for specific job

Post by oleg.feoktistov »

Hi Brent,

You can easily get the id of the encryption key being used in a job with the following code:

Code: Select all

$job = Get-VBRJob -Name 'Backup Job' 
$job.UserCryptoKey.Id

Thanks,
Oleg

ipro-bgardner
Novice
Posts: 6
Liked: 2 times
Joined: May 07, 2021 4:43 pm
Full Name: Brent Gardner
Contact:

Re: Get encryption key for specific job

Post by ipro-bgardner »

Works beautifully.

I was using Get-VBRComputerBackupJob as my starting point, which doesn't have the UserCryptoKey property.

Thanks!

oleg.feoktistov
Veeam Software
Posts: 1006
Liked: 364 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get encryption key for specific job

Post by oleg.feoktistov »

I see no problems with Get-VBRComputerBackupJob either. It's just that the object structure is a bit different here:

Code: Select all

$job = Get-VBRComputerBackupJob -Name 'Linux Backup'
$job.StorageOptions.EncryptionKey.Id 
I would advise using Get-VBRComputerBackupJob cmdlet in your case as Get-VBRJob doesn't support agent management jobs.

Thanks,
Oleg

ipro-bgardner
Novice
Posts: 6
Liked: 2 times
Joined: May 07, 2021 4:43 pm
Full Name: Brent Gardner
Contact:

Re: Get encryption key for specific job

Post by ipro-bgardner »

Nice.

Simpler code, faster, and I don't get warnings about Get-VBRJob and computer backup jobs.

Regards,
Brent

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests