PowerShell script exchange
heyruon
Lurker
Posts: 1 Liked: never
Joined: Jan 26, 2017 7:28 pm
Post
by heyruon » Mar 21, 2018 3:07 am
this post
So, I've been backing up my VMs for months now and for some reason, I never tested a restore until I needed one tonight.
I created my secure encryption file using the following:
Code: Select all
#Encryption file
$SecurePassword = Read-Host -Prompt "Enter password" -AsSecureString
$SecurePassword | ConvertFrom-SecureString > C:\Scripts\Veeam_Secure.txt
I then used what I thought was the standard way of encrypting the backups using the following:
Code: Select all
# Protect resulting backup with encryption key (Optional; $True/$False)
$EnableEncryption = $True
# Encryption Key (Optional; path to a secure string)
$EncryptionKeyPath = "C:\Scripts\Veeam_Secure.txt"
If ($EnableEncryption)
{
$EncryptionKey = Add-VBREncryptionKey -Password (cat $EncryptionKeyPath | ConvertTo-SecureString)
$ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention -EncryptionKey $EncryptionKey
}
My guess is that I'm concatenating the password or screwing it up at some point as I'm typing in PLAIN text the password in to the Veeam GUI when trying to restore and it's telling me invalid password. Any ideas? And is there any way I can figure out what the actual password is from the secure string in the file and the above code?
Thanks in advance!
Andreas Neufert
VP, Product Management
Posts: 7076 Liked: 1510 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:
Post
by Andreas Neufert » Apr 01, 2018 8:31 pm
this post
Maybe run the script above again on sam machine and then just add
$EncryptionKey
at the end ... it should output the key that you have set.
Users browsing this forum: No registered users and 16 guests