Hello all
I'm looking for a way to get some information from job statistics via powershell. Especially I'm interested in removing vm snapshot time for each VM in a certain job. In GUI you can right click a job, choose statistics, select a VM and scroll down to this entry. Is it possible or do I have to look for this information directly in DB?
Thanks in advance
Christian
-
- Service Provider
- Posts: 13
- Liked: 2 times
- Joined: Feb 08, 2013 8:45 am
- Full Name: Christian
- Contact:
-
- Service Provider
- Posts: 13
- Liked: 2 times
- Joined: Feb 08, 2013 8:45 am
- Full Name: Christian
- Contact:
Re: Get Statistics subtask with powershell
Nevermind, I found a solution:
Code: Select all
$Jobs = Get-VBRJob -Name "Name*"
foreach ($Job in $Jobs) {
$LastSession = $Job.FindLastSession()
$TaskSessions = $LastSession | Get-VBRTaskSession
foreach ($vm in $TaskSessions) {
$asd = $vm.Logger.GetLog().UpdatedRecords | where-object {$_.title -eq "Removing VM snapshot"} | Select-Object title, starttime, updatetime
$diff = $asd.updatetime - $asd.starttime
Write-Host $vm.Name `t $diff.TotalMinutes
}
}
-
- Product Manager
- Posts: 20270
- Liked: 2252 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Get Statistics subtask with powershell
I have to admit you wrote a nice script, indeed. Thanks for sharing it with the community; highly appreciated.
Who is online
Users browsing this forum: Google [Bot] and 15 guests