PowerShell script exchange
Post Reply
rwykoff
Lurker
Posts: 1
Liked: never
Joined: Dec 28, 2022 2:00 pm
Full Name: Robert Wykoff
Contact:

Powershell commands to add one time password to Linux repository setup

Post by rwykoff »

The below script is what i am trying to use to setup a linux repository with a one time password. When the script is ran it creates a normal password, but fails to successfully backup anything to the repository and tells me the Linux server needs to be rescanned but is not able to complete the scan. Not sure if i am missing something or if it is not possible to create the immutable repository from PS. if i create it in the GUI it works fine.

Script

Code: Select all

$repostoryName = Read-Host -Prompt 'Enter name of repository '
$Server = Read-Host -Prompt 'Enter Linux Server IP Address '
$Password = Read-host -Prompt 'Enter Username Password ' -AsSecureString
$Repostory = Read-host -Prompt 'Enter the backup repository name '
$ImmutabilityPeriod = Read-Host -Prompt 'Enter Immutability period days (Must be more then 7) '


$plainPwd =[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password))
$linsrv = Add-VBRLinux -Name $Server -SSHUser username -SSHPassword $plainPwd -SSHElevateToRoot
Add-VBRBackupRepository -Name "CAR Server" -Server $linsrv -EnableBackupImmutability -ImmutabilityPeriod $ImmutabilityPeriod -DecompressDataBlocks -UsePerVMFile -EnableXFSFastClone -Type LinuxLocal -Folder $Repostory
Mildur
Product Manager
Posts: 8735
Liked: 2294 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Powershell commands to add one time password to Linux repository setup

Post by Mildur »

Hi Robert

Welcome to the forum.
It should work, but you need to use the parameter -SSHTempCredentials $True for the command Add-VBRLinux.
I missing it in your sample script.

https://helpcenter.veeam.com/docs/backu ... ml?ver=110
SSHTempCredentials
To add a Linux server that will be used as a hardened repository.
Defines that the cmdlet will use single-use credentials to access a Linux server.
Thanks,
Fabian
Product Management Analyst @ Veeam Software
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests