Select Page

Symantec Backup Exec PowerShell report

Symantec Backup Exec PowerShell report

Symantec Backup Exec PowerShell

I was wondering if it is possible to connect using PowerShell to Symantec Backup Exec server, and pull a summary of backup jobs. You might think that Symantec Backup Exec already has many notification options, so why to invest time to do that via PowerShell.

Well, imagine that you have a complex backup cycle and you want to do customized reporting, but you need to get the data first. Also, sometimes you might have many installations of Backup Exec and you want to generate one report. It is always nice to know that you can use PowerShell to query information about your Backup Exec server.

Symantec Backup Exec PowerShell report

This script will connect to Symantec Backup Exec server and using PowerShell, and will collect the following  information about the backup jobs:

  • Job Name
  • Selection Summary
  • Storage
  • Start Time
  • Elapsed Time
  • Job Status
  • Media Label
  • Total Data Size Bytes
  • Job Rate MB Per Minute

Script Filters

The script has two filters:

  • Name Like Expression: You can say for example ,give me jobs where the name contains “*OffSite*”
  • Time Expression: You can either use:
    • Since X Days: like give me all jobs happened since X days.
    • From Last Job Run: give me the last job run information for the jobs.

Script Parameters

Below is the list of Script Parameters:

ScriptFilesPath
Path to store script files like “.\” to indicate current directory or full path like C:\myfiles.

SendMail
Send Mail after completion. Set to $True to enable. If enabled, -MailFrom, -MailTo, -MailServer are mandatory

MailFrom
Email address to send from.

MailTo
Email address to send to.

NameLike
Expression filter to filter on Job names. Example is “*OffSite*” to filter for any job with the word “OffSite” in the job name.

Days
Filter jobs happening in the past X days.This parameter cannot be used with the -FromLastJobRun switch parameter

FromLastJobRun
Switch parameter. When used, the script will bring only the last run job instances. This switch parameter cannot be used with the -Days parameter.

Script Examples

Get BackupExec Jobs and send email with the results

Get BackupExec Jobs happening in the last 3 days

Get BackupExec Jobs with the name containing “*Yearly*”

Get BackupExec Jobs with the name containing “*Yearly*” and only returning the last job run results

Get BackupExec Jobs with the name containing “*Yearly*” happening last week

Script Output

The script will generate three log files:

  • Info Log : will help you track what the script is doing.
  • Error Log : in case of errors
  • Detailed Log : contains detailed information about each job run

The script will also generate a nice HTML table that contains the list of jobs and their information

The script has an option to send results via an email if you choose to configure SMTP settings via one of the script parameters.

Backup Exec PowerShell

Notes

The challenge I faced writing this script is querying the Media Label field because this field is obtained from the XML returned by the Get-JobLog.

So if you write Get-Job | Get-JobHistory | GetJobLog

Then you will have XML file with the media label information there. I had to do some string operations to extract the media label information.

The script should be running from within the BackupExec server and it is tested with BackupExec 2014 only.

You can download the script from Microsoft TechNet Gallery.

 

About The Author

Ammar Hasayen

Ammar is a digital transformer, cloud architect, public speaker and blogger.
He is considered a trusted advisory with the ability to quickly navigate complex multi-cultural organizations and continuously improve and motivate cross-functional teams to achieve higher productivity, collaboration, revenue gain and cross-group knowledge sharing.

His contributions to the tech community helped him get awarded the Microsoft Most Valuable Professional.

Ammar appears in a lot of global conferences, and he has many publications about digital transformation and next generation technologies.

15 Comments

  1. MP

    How hard would it be to show all the tapes used in a backup job instead of just the one tape?

    Reply
    • ammar hasayen

      Problem that they are not listed in same line but seperated in multiple lines..so it is hard to find a terminator where the tape list ends.. this is because im doing substring on the job log xml which is not easy and not object based.

      Reply
    • ammar hasayen

      im trying to get it, but the PowerShell module does not provide such information even when pulling the XML of the job itself. I will continue to search and see.

      Reply
  2. RC

    Ammar: Great Job on this. Pulling values like All Media Used and other useful metrics is not trivial, even when using the BE reporting tool. I do agree that multiple tapes / storage B2D files is valuable, but it also makes a bloated report. A consideration if you revise the script might be to add a hyperlink in the job name that would open the job log XML file. (Of course assuming read access to the Backup Exec log files). The script does work on BE2012 too.

    Reply
    • ammar hasayen

      Thanks.. i will do another try to understand how data is stored and try to pull it. Hope it will work 🙂

      Reply
  3. RC

    Ammar
    Thanks for looking into it. I wonder if Symantec just takes all the media labels from a given job log then just removes the duplicates and displays that output as All Media Used?

    Reply
  4. Marco

    Ammar, first of all, congrats for the fantastic script you’ve developed! I would like to ask why the report gives me the last ran jobs plus the queue jobs stated as N/A?

    Reply
  5. Yasar

    Thank you very much for this script Ammar!

    When I run this script, I’m having many N/A jobs as output, Can I exclude this?
    If possible and you don’t know what I mean with N/A. I can send the output to you?

    Reply
    • ammar hasayen

      Sure mean while i will review the script again

      Reply
      • Yasar

        Hi Amar,

        Did you have reviewed the script?

        Reply
  6. Andrew

    Hey Ammar,

    I’m not all that familiar with powershell so I was wondering if you could tell me how to filter for two different job names at once? I’ve got it to filter for one but when I add a second one like this: “job 1”, “job 2” it just crashes and won’t run

    Reply
    • todd hammer

      I was wondering this as well. This would be really helpful.
      I LOVE THIS SCRIPT!!

      Reply
  7. BJA

    Hello Ammar,
    Very good script, I use it everyday
    Could you please add an option for TotalDataSizeBytes in GB ?
    I’m think it’s more practical.

    Thanks.

    Reply
  8. George rodriguez

    Is there a way to add Totaldatasizebytes in GB

    Reply
  9. Hussam

    Ammar,

    I love your script… I am new to scripting, but i was trying to modify it to display currently running jobs as well. Can you point me to where i can change that

    Reply

Leave a reply

Your email address will not be published. Required fields are marked *

Ammar_Hasayen_MVP_1

About Ammar

Digital Transformation | Microsoft MVP | Cloud Architect | Azure | Microsoft 365 |Modern Workplace | Cyber-Security | Blockchain | Speaker | Blogger | IT Director @ Aramex| Jordan | http://me.ahasayen.com

Recent Posts

Pin It on Pinterest