PowerShell script exchange
Post Reply
heyruon
Lurker
Posts: 1
Liked: never
Joined: Jan 26, 2017 7:28 pm

Restore failing, invalid password?

Post by heyruon »

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:

Re: Restore failing, invalid password?

Post by Andreas Neufert »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests