none
Powershell Script for Producing DPM Alert File RRS feed

  • Question

  • I'm looking for the script, possibly powershell script that is used to produce a text file of the current DPM Alerts. 

    Recently, I opened an incident with Microsoft and they provided the program "Microsoft Automated Troubleshooting Services" which produced a number of files that were sent to Microsoft.  One of the files was DPM05_evt_DPMAlerts.txt.  In this file it had the following:

    Date       Time          Type/Level    Computer Name    EventID Source                              Task Category      Username                          Message
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    11/27/2013 01:11:38 AM   Warning       DPM05.NY. 3100    DPM-EM                              N/A                N/A                               The used disk space on the computer running DPM for the replica of  D:\ has exceeded the threshold value of 90%, or there is not enough disk space to accommodate the changed data. If you do not allocate more disk space, synchronization jobs may fail. (ID: 3100)

    12/05/2013 09:35:16 PM   Error         DPM05.NY. 3114    DPM-EM                              N/A                N/A                               Creation of recovery points for Non VSS Datasource Writer on usmeps011.usa.wtbts.net have failed. The last recovery point creation failed for the following reason: (ID: 3114) DPM does not have sufficient storage space available on the recovery point volume to create new recovery points. (ID: 214)

    I would love to reproduce this for my own troubleshooting.

    Could anyone point me to where I could get a Powershell script to produce this type of file with DPM Alerts?

    Thank you.

    -Jenna

    Friday, December 6, 2013 4:58 PM

Answers

  • #******************************************************************************************
    # This PowerShell script captures the DPM Alerts from the Windows Event Viewer,
    #    places the data in a formatted email message to send to the Admin.
    #******************************************************************************************
    function SendMail ($MsgTo, $MsgSubject, $MsgBody) {
        Send-MailMessage -SmtpServer <yourMailServerName> -From <yourAdminEmailAddress> -To $MsgTo -Subject $MsgSubject -Body $MsgBody -BodyAsHtml
    }
    
     $MsgHeader = "<html><table border =`"1`" style=`"text-align:center`" cellpadding=`"5`"><th style=`"color:#6698FF`">
     <big>Windows DPM Event Alerts</big></th><body><tr><th>Date</th><th>Entry Type</th><th>Source</th><th>Message</th></tr>" 
    
    $MsgBody = ""
    $ErrorCounter = 0
    $WarningCounter = 0
    
    $today = Get-Date
    $yesterday = (Get-Date).AddDays(-1)
    
    #*******************************************************************************************
    #   Get Errors from DPM Alerts Event log
    #*******************************************************************************************
    $errors = get-eventlog "DPM Alerts" -EntryType Error -Before $today -After $yesterday
    
    $MsgBody = $MsgHeader
    
    for($i=0; $i -le ($errors.count)-1; $i++){
        $DPMServer = $errors[$i].machinename
        $TimeGenerated = $errors[$i].Timegenerated
        $Source = $errors[$i].Source
        $EntryType = $errors[$i].EntryType
        $ErrorMsg = $errors[$i].Message
    
        $ErrorCounter++ 
        $MsgBody += "<tr><td>" + $TimeGenerated + "</td><td>" + $EntryType + "</td><td>" + $Source + "</td><td>" +  $ErrorMsg + "</tr>"
    }
    #*******************************************************************************************
    #   Get Warnings from DPM Alerts Event log
    #*******************************************************************************************
    $errors = get-eventlog "DPM Alerts" -EntryType Warning -Before $today -After $yesterday
    
    for($i=0; $i -le ($errors.count)-1; $i++){
        $DPMServer = $errors[$i].machinename
        $TimeGenerated = $errors[$i].Timegenerated
        $Source = $errors[$i].Source
        $EntryType = $errors[$i].EntryType
        $ErrorMsg = $errors[$i].Message
    
        $ErrorCounter++
        $MsgBody += "<tr><td>" + $TimeGenerated + "</td><td>" + $EntryType + "</td><td>" + $Source + "</td><td>" +  $ErrorMsg + "</tr>"
    }
    $MsgBody+= $MessageEnd =  "</body></html>" 
    SendMail -MsgTo <yourEmailAddress> -MsgSubject "DPM Alerts Event Log ($DPMServer): $ErrorCounter Errors & Warnings" -MsgBody $MsgBody

    • Marked as answer by Jenna Katie Friday, December 20, 2013 10:24 PM
    Friday, December 20, 2013 10:24 PM