PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Get Datadomain credentials

Post by matteu »

Hello,

What is the cmdline to find the credentials used on a datadomain repository ?

Thanks for your answer.
chris.arceneaux
VeeaMVP
Posts: 668
Liked: 359 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Georgia, USA
Contact:

Re: Get Datadomain credentials

Post by chris.arceneaux »

Following the instructions in this KB article will provide you what you're looking for:

https://www.veeam.com/kb4349
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get Datadomain credentials

Post by matteu »

Thanks for your answer, unfortunately it's not what I want exactly ^^.
I'm sorry maybe I didn't say it correctly.

I just need the account used and not the password.
chris.arceneaux
VeeaMVP
Posts: 668
Liked: 359 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Georgia, USA
Contact:

Re: Get Datadomain credentials

Post by chris.arceneaux »

I don't have a data domain in my lab but perhaps this will work:

Code: Select all

$repo = Get-VBRBackupRepository -Name "repository-name"
$repo.Credentials
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get Datadomain credentials

Post by matteu »

Should be fine but unfortunately it's not :)

For SMB I used this : (Get-VBRCredentials | Where-Object {$_.id -eq (Get-VBRBackupRepository -name "xxxxxx").ShareCredsId.guid}).name

There is maybe an other way but I'm not sure ^^.
For Datadomain, ShareCredsId = 00000000..... so it's not working
chris.arceneaux
VeeaMVP
Posts: 668
Liked: 359 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Georgia, USA
Contact:

Re: Get Datadomain credentials

Post by chris.arceneaux »

This should do the trick. With Data Domain, the credential isn't specified at the repository. With that in mind, we need to look at the Linux host that holds the repository:

Code: Select all

$creds = Get-VBRCredentials
$repo = Get-VBRBackupRepository -Name "repository-name"
$server = $repo.Host
$ssh = $server.GetSshCreds()
$creds | Where-Object {$_.Id -eq $ssh.CredsId}
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get Datadomain credentials

Post by matteu »

Hello,

Thanks for your answer.
I just test it now and it's not working

$creds = Get-VBRCredentials -> OK
$repo = Get-VBRBackupRepository -Name "REPO_Datadomain_PX" -> OK
$server = $repo.Host -> Result is VBR server object. Not sure it's what we want ?
$ssh = $server.GetSshCreds() -> Empty because it's VBR server I guess
$creds | Where-Object {$_.Id -eq $ssh.CredsId} -> Empty
chris.arceneaux
VeeaMVP
Posts: 668
Liked: 359 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Georgia, USA
Contact:

Re: Get Datadomain credentials

Post by chris.arceneaux »

As you surmised, the sample code is failing because $repo.Host is the VBR server object and not the Data Domain.

Perhaps @oleg.feoktistov has the answer :mrgreen:
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get Datadomain credentials

Post by matteu »

Yes.
i usually try some different commands before I post here ans very often oleg gives me the answer :)
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get Datadomain credentials

Post by oleg.feoktistov » 1 person likes this post

Hi guys,

Looks like data domain view doesn't belong to the CBackupRepository class, so there isn't any obvious way to get creds for this type. But hey, look at the workaround I found:

Code: Select all

$dd = Get-VBRBackupRepository -Name "Data domain repo"
[Veeam.Backup.DBManager.CDBManager]::Instance.DataDomainRepositoryServers.FindDataDomainServerForRepository($dd.Id)
Credentials id used should be in the output.

Best regards,
Oleg
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get Datadomain credentials

Post by matteu »

It works fine with this cmdlet ^^

Thanks
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 8 guests