locked
DFSR Errors in event viewer RRS feed

  • Question

  • Hi All,

    May I ask for your help on how can I create a powershell script that will send an email to me whenever dfsr encounter issues and logged in event viewer. already did research and I am having trouble on the smtp server. Currently our email use by our company is web based and online. so I'm wondering if its possible. Thank you.

    Regards,

    Pao

    Thursday, January 16, 2020 6:47 AM

Answers

  • Hi,

    PowerShell questions are best asked in the dedicated PowerShell forum, please also note that they will not write scripts for you, they may assist you with any scripting issues that you encounter.

    Scripting > Windows PowerShell (Please read the posting guidelines first!)

    To help you get started, you would need to create a PowerShell script that is run with Scheduled Tasks, in the script you can check for any errors in the "DFS Replication" log, and if any errors exist, send an email.

    Here's an example on how to retrieve all errors within the DFS Replication event log:

    Get-EventLog -LogName 'DFS Replication' | where {$_.EntryType -eq "Error"}

    If you only want to retrieve the newest error, you can do as follows:

    $EventLog = Get-EventLog -LogName 'DFS Replication' | Where {$_.EntryType -Eq "Error"}
    
    $EventLog | Select-Object -Index 0, ($EventLog.Count -1)

    Here's a link that goes through email notifications with PowerShell:
    How to Send an Email Using Windows PowerShell

    You can also find some scripts in the TechNet Gallery, here's one for example:

    Monitor DFS backlog and Send email notification

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, January 16, 2020 7:52 AM

All replies

  • Hi,

    Thanks for posting here!

    I did some research, found the script for Monitor DFS backlog and Send email notification,hope it would be helpful for you:

    https://gallery.technet.microsoft.com/scriptcenter/Monitor-DFS-backlog-and-f2761f16

    For the scripts ,I suggest you refer to experts from the following script forum to get professional support:

    https://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG&filter=alltypes&sort=lastpostdesc

    Best Regards,

    Fan


    Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, January 16, 2020 7:48 AM
  • Hi,

    PowerShell questions are best asked in the dedicated PowerShell forum, please also note that they will not write scripts for you, they may assist you with any scripting issues that you encounter.

    Scripting > Windows PowerShell (Please read the posting guidelines first!)

    To help you get started, you would need to create a PowerShell script that is run with Scheduled Tasks, in the script you can check for any errors in the "DFS Replication" log, and if any errors exist, send an email.

    Here's an example on how to retrieve all errors within the DFS Replication event log:

    Get-EventLog -LogName 'DFS Replication' | where {$_.EntryType -eq "Error"}

    If you only want to retrieve the newest error, you can do as follows:

    $EventLog = Get-EventLog -LogName 'DFS Replication' | Where {$_.EntryType -Eq "Error"}
    
    $EventLog | Select-Object -Index 0, ($EventLog.Count -1)

    Here's a link that goes through email notifications with PowerShell:
    How to Send an Email Using Windows PowerShell

    You can also find some scripts in the TechNet Gallery, here's one for example:

    Monitor DFS backlog and Send email notification

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, January 16, 2020 7:52 AM
  • It's possible. But you should add your mail service SMTP settings correctly. You can check that with your email vendor support.

    mentioned script details by flingmin may be helpful to write script.

    Thursday, January 16, 2020 10:43 AM
  • Hi,
     
    Just want to confirm the current situations.
     
    Please feel free to let us know if you need further assistance.
     
    Best Regards,
    Cynthia

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, January 20, 2020 9:33 AM
  • Hi,

    Hope the information provided above was helpful for you.

    Please feel free to let us know if you need further assistance in the future.

    Best Regards,
    Fan



    Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, January 22, 2020 2:22 AM