PowerShell script exchange
Post Reply
Lucas_H
Influencer
Posts: 17
Liked: 4 times
Joined: Nov 16, 2018 3:14 pm
Full Name: Lucas HELLMANN
Location: Lyon, FRANCE
Contact:

Get computer name inside Veam Protection groups

Post by Lucas_H »

Hello everyone,

I'm looking for a way in Powershell to get the name of the Physical server inside Computer groups.

My problem is that I have some Windows Agent Backup Job, one per client, with their physical servers inside a protection group.
I want to be able to retrieve these Jobs, and see which servers are inside the backup.

Do you know any way of doing this in Powershell ?
I already tried something like this :

Code: Select all

asnp veeampssnapin
$Jobs = Get-VBRJob | ?{$_.TypetoString -eq "Windows Agent Backup"}
ForEach ($job in $jobs) {
    foreach ($object in $job.GetObjectsInJob()) { }
Getting the Job and then getting the Object inside, but I know that I need to go one level deeper as my servers are inside the protection group. And i have no clue how to do that.

Cheers,
Lucas H
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get computer name inside Veam Protection groups

Post by veremin »

I don't have a console at hand, but what if you get a Protection Group, using Get-VBRProtectionGroup cmdlet, and, then, check objects included in it ($Group.Container). Thanks!
Lucas_H
Influencer
Posts: 17
Liked: 4 times
Joined: Nov 16, 2018 3:14 pm
Full Name: Lucas HELLMANN
Location: Lyon, FRANCE
Contact:

Re: Get computer name inside Veam Protection groups

Post by Lucas_H »

Hello,

It indeed work, thanks for the help !

I did it like this:

Code: Select all

asnp veeampssnapin
$Groups = Get-VBRProtectionGroup
foreach ($Group in $Groups) {
    $Group.Name
    foreach ($object in $Group.Container) {$object}
}
But, when I created the Protection group, I added the servers with their IP and not by their DNS name, so with this script, I only get the IP and not the name like displayed in the B&R interfaces.
Do you know of any way to change this ?
Do I need to add the server in the Protection Groups with their DNS and then remove the record by their IP ?

Cheers,
Lucas H
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get computer name inside Veam Protection groups

Post by veremin »

Correct, objects are exposed in PowerShell exactly the way they've been added to backup console. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests