Scripting examples > Job information scripts > Viewing job Event messages

Viewing job Event messages

Most Double-Take Event messages are located in the Application Log with a Source of Double-Take or Double-Take Management Service. You will also find some Event messages in the System log under RepDrv. See the User's Guide for details on all of the Double-Take Event messages.

The following sample scripts will gather Double-Take specific Event messages. The cmdlets used in these scripts are not Double-Take cmdlets. They are Windows PowerShell cmdlets. See your Windows PowerShell documentation for more details and examples on how to use these cmdlets.

You will need to modify this script to fit your environment and configuration.

Be sure and expand your screen wide enough so that lines in the script file do not wrap.

 

# Sample script to view job Event messages

 

# Set the date for how far back you want to view

$Date = get-date 01/15/2017

 

# Display all Double-Take and Double-Take Management Service Event messages

# since the date you specified

Get-EventLog -LogName Application -Source @("Double-Take", "Double-Take Management Service") -After $Date

 

# Sample script to view job Event messages

 

# Display the last five Double-Take or Double-Take Management Service Event

# messages, listing all properties of the Events

Get-EventLog -LogName Application -Source @("Double-Take", "Double-Take Management Service") -Newest 5 | format-list -property *

 

# Sample script to view job Event messages

 

# Set the values of the Event IDs you want to see

$FirstEventId = 4065     # Target data state change

$SecondEventId = 4111    # Sharing violation on target

$ThirdEventId = 8196     # Memory issues on source

 

# Set the date for how far back you want to view

$Date = get-date 01/15/2017

 

# Display specific Double-Take or Double-Take Management Service Event messages

# based on the Event IDs

Get-EventLog -LogName Application -Source @("Double-Take", "Double-Take Management Service") -After $Date | Where-Object {$_.EventID -eq $FirstEventId -or $_.EventId -eq $SecondEventId}

 

# Display specific RepDrv Event messages based on the Event IDs

Get-EventLog -LogName System -Source RepDrv -After $Date | Where-Object {$_.EventID -eq $ThirdEventId}

 

# Sample script to view job Event messages

 

# Display specific Double-Take or Double-Take Management Service Event messages

# based on the Event index number, and listing all properties of the Event

Get-EventLog -LogName Application -Source @("Double-Take", "Double-Take Management Service") | Where-Object {$_.Index -eq 99461} | format-list -property *

 

If you want to hide your user credentials in your script, use the Windows PowerShell Get-Credential cmdlet. The password will not be visible because Windows stores an encrypted password. See Hiding your password in a PowerShell script for basic details on using this cmdlet. See your Windows PowerShell documentation for detailed instructions.