Kelly Garcia
asked on
Powershell script for BackupExec
Hi All,
I have written the script below
I know need this information as well as information about name of the job and completion time as well if the media is currerently being used.
so my idea now is to store the mediasetid in a variable, then loop through it and get more information via get-bejob.
I need help how to writethis and get more information. so far idea is:
$mediasetid = Get-BEMedia | ? {$_.LastModifiedDate -ge (Get-Date).AddHours(-24)} | select MediaSetId
$mediasetid | % { get-bejob | ? {$_.mediasetid -eq $mediaset}} but how do I also out the information I obtained previously, "select name, mediaset, mediasetid, lastmodifieddate, LocationName"
thank you in advance.
I have written the script below
Get-BEMedia | ? {$_.LastModifiedDate -ge (Get-Date).AddHours(-24)} | select name, mediaset, mediasetid, lastmodifieddate, LocationName
I know need this information as well as information about name of the job and completion time as well if the media is currerently being used.
so my idea now is to store the mediasetid in a variable, then loop through it and get more information via get-bejob.
I need help how to writethis and get more information. so far idea is:
$mediasetid = Get-BEMedia | ? {$_.LastModifiedDate -ge (Get-Date).AddHours(-24)} | select MediaSetId
$mediasetid | % { get-bejob | ? {$_.mediasetid -eq $mediaset}} but how do I also out the information I obtained previously, "select name, mediaset, mediasetid, lastmodifieddate, LocationName"
thank you in advance.
Hi Kay
have you tried this yet ? how did you get on
Joe
have you tried this yet ? how did you get on
Joe
ASKER
apologies I will do this today, I was running it last week but it was taking ages
ASKER
this don't give me any values, this is resuts:
Name Value
---- -----
jobinfoID
name
mediaset
lastmodifieddate
LocationName
jobinfoID
name
mediaset
lastmodifieddate
LocationName
jobinfoID
name
mediaset
lastmodifieddate
LocationName
jobinfoID
name
mediaset
lastmodifieddate
LocationName
jobinfoID
name
mediaset
lastmodifieddate
LocationName
jobinfoID
name
mediaset
lastmodifieddate
LocationName
jobinfoID
name
mediaset
lastmodifieddate
LocationName
jobinfoID
name
mediaset
lastmodifieddate
LocationName
jobinfoID
name
mediaset
lastmodifieddate
LocationName
Can you verify what version of powershell you are running , you can find this by typing
$host.version
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
how do I get the job name?
ASKER
were almost there, thank you for the help
Hi try adding this line at line 10
jobName = $jobinfo.name;
I do not have backup exec in my environment but the following should help you . At line 14 you can add as many of the fields from the job information in , I have added the only one i know about ($jobinfo.mediasetid)
Please let me know how you get on.
Joe
Open in new window