-
- Enthusiast
- Posts: 73
- Liked: 9 times
- Joined: May 25, 2010 3:27 pm
- Full Name: mike
- Contact:
Create Application Group from Imported Backups
Hi,
Just wondering if anyone can help get me a bit further with my attempts..
What I want to do is import a bunch of backups, create an application group, create the surebackup job, and run it...all through powershell.
I've gotten myself to the point where I've imported the backups, but cannot seem to find a way to create the application group.
I know I need to use add-vsbapplicationgroup which is asking for a VM to put in the appgroup...how do i get the VM object out of my imported backups in order to add it to the application group?
Make sense?
Thanks for any help...
Mike
Just wondering if anyone can help get me a bit further with my attempts..
What I want to do is import a bunch of backups, create an application group, create the surebackup job, and run it...all through powershell.
I've gotten myself to the point where I've imported the backups, but cannot seem to find a way to create the application group.
I know I need to use add-vsbapplicationgroup which is asking for a VM to put in the appgroup...how do i get the VM object out of my imported backups in order to add it to the application group?
Make sense?
Thanks for any help...
Mike
-
- Veteran
- Posts: 293
- Liked: 19 times
- Joined: Apr 13, 2011 12:45 pm
- Full Name: Thomas McConnell
- Contact:
Re: Create Application Group from Imported Backups
You need to do a bit of fetching but this will achieve what your looking for
Code: Select all
$vms = Get-VBRJob -Name "Imported Job" | Get-VBRJobObject
$vmAry = @()
foreach ($vm in $vms) {
$vmHost = $vm.getobject().GetHost()
$vmObj = Find-VBRObject -Server $vmHost -Name $vm.Name
$vmAry = $vmAry + $vmObj
}
Add-VSBApplicationGroup -Name "Test App Group" -Vm $vmAry
-
- Enthusiast
- Posts: 73
- Liked: 9 times
- Joined: May 25, 2010 3:27 pm
- Full Name: mike
- Contact:
Re: Create Application Group from Imported Backups
I guess i should have been a little more clear. I dont actually have a backup job imported. Just the backup files themselves. Is there a cmdlet i can use to do the same tasks with just the imported backups (not the job). Thanks so much for the help.
-
- Veteran
- Posts: 293
- Liked: 19 times
- Joined: Apr 13, 2011 12:45 pm
- Full Name: Thomas McConnell
- Contact:
Re: Create Application Group from Imported Backups
Ah, Sorry Mike try this way
Code: Select all
$vms = (Get-VBRBackup -Name "Imported Backup Files").GetObjects()
$vmAry = @()
foreach ($vm in $vms) {
$vmHost = $vm.GetHost()
$vmObj = Find-VBRObject -Server $vmHost -Name $vm.Name
if ($vmHost.Type -eq "VC") {
$vmAry = $vmAry + $vmObj[0]
}
else {
$vmAry = $vmAry + $vmObj
}
}
Add-VSBApplicationGroup -Name "Test App Group" -Vm $vmAry
-
- Veteran
- Posts: 293
- Liked: 19 times
- Joined: Apr 13, 2011 12:45 pm
- Full Name: Thomas McConnell
- Contact:
Re: Create Application Group from Imported Backups
Having another think about it, this is more what your looking for I guess
Code: Select all
$ibfOibs = (Get-VBRBackup -Name "Imported Backup Files").GetLastOibs()
Add-VSBApplicationGroup -Name "Test App Group" -RestorePoint $ibfOibs
-
- Enthusiast
- Posts: 73
- Liked: 9 times
- Joined: May 25, 2010 3:27 pm
- Full Name: mike
- Contact:
Re: Create Application Group from Imported Backups
Yes, the second option is exactly what I needed. Thanks so much! Mike
Who is online
Users browsing this forum: No registered users and 16 guests