how to translate TargetHostID to the guest server name?

PowerShell script exchange

Re: how to translate TargetHostID to the guest server name?

Veeam Logoby dannordquist » Thu Nov 13, 2014 12:51 pm

you are THE MAN! Yep, that returns a bool... thank you!
dannordquist
Enthusiast
 
Posts: 27
Liked: 2 times
Joined: Thu Oct 23, 2014 3:39 pm
Full Name: Dan Nordquist

Re: how to translate TargetHostID to the guest server name?

Veeam Logoby dannordquist » Wed Nov 19, 2014 2:12 pm

Another quick question if you don't mind. The veeam jobs sometimes report warnings on the job itself while all the server backups have successfully completed, like this one, "Backup location "E:\Veeam\Backups" is getting low on free disk space (757.3 GB left of 7.3 TB)."

Can you suggest a way to pull the details of that warning?

Also, I am going to post the code I have to share with the forum in a following post. This is so people can use the script you have taught me and improve upon it if they so desire.

Thanks for all your help!
Dan
dannordquist
Enthusiast
 
Posts: 27
Liked: 2 times
Joined: Thu Oct 23, 2014 3:39 pm
Full Name: Dan Nordquist

Re: how to translate TargetHostID to the guest server name?

Veeam Logoby nefes » Wed Nov 19, 2014 2:19 pm

Here is the code I use in testing, may require some improvements:
Code: Select all
$session = (Get-VSBSession -Name $jobName | Sort-Object StartTime -Descending)[0] # I use it in SureBackup, use corresponding commandlet to search your type of session
$warnings = $session.Logger.GetLog().UpdatedRecords | ?{$_.Status -eq "EWarning"} | Sort-Object UpdateTime | Select -ExpandProperty Title
$fails = $session.Logger.GetLog().UpdatedRecords | ?{$_.Status -eq "EFailed"} | Sort-Object UpdateTime | Select -ExpandProperty Title
nefes
Veeam Software
 
Posts: 534
Liked: 125 times
Joined: Mon Dec 10, 2012 8:44 am
Full Name: Nikita Efes

Re: how to translate TargetHostID to the guest server name?

Veeam Logoby dannordquist » Wed Nov 19, 2014 2:32 pm

Thanks nefes, I'll play with that.
dannordquist
Enthusiast
 
Posts: 27
Liked: 2 times
Joined: Thu Oct 23, 2014 3:39 pm
Full Name: Dan Nordquist

Re: how to translate TargetHostID to the guest server name?

Veeam Logoby dannordquist » Thu Nov 20, 2014 1:01 pm

Can't get that script to work, nefes. I'm a C# expert but not a PS expert so I don't know how to fix the errors I'm getting. I sure am learning PS quickly, though! haha

Vladimir, do you have any suggestions for me, to get the job failure when it's not associated with a server, like the disk space warning above?

Thanks!
dannordquist
Enthusiast
 
Posts: 27
Liked: 2 times
Joined: Thu Oct 23, 2014 3:39 pm
Full Name: Dan Nordquist

Re: how to translate TargetHostID to the guest server name?

Veeam Logoby v.Eremin » Thu Nov 20, 2014 1:09 pm

Don't those warnings show up, if you query backup sessions, like I've described previously? Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: how to translate TargetHostID to the guest server name?

Veeam Logoby dannordquist » Thu Nov 20, 2014 1:20 pm

I'll see if I can figure it out based on your previous scripts.
dannordquist
Enthusiast
 
Posts: 27
Liked: 2 times
Joined: Thu Oct 23, 2014 3:39 pm
Full Name: Dan Nordquist

Re: how to translate TargetHostID to the guest server name?

Veeam Logoby dannordquist » Wed Nov 26, 2014 4:02 pm

yes, you were right, I just needed to getLog() for the job level result in addition to the task level results

thanks again for your help!
dannordquist
Enthusiast
 
Posts: 27
Liked: 2 times
Joined: Thu Oct 23, 2014 3:39 pm
Full Name: Dan Nordquist

Re: how to translate TargetHostID to the guest server name?

Veeam Logoby v.Eremin » Wed Nov 26, 2014 7:45 pm

No worries. Glad to hear that my input has been helpful. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Previous

Return to PowerShell



Who is online

Users browsing this forum: Bing [Bot] and 4 guests