APM - How to handle failed fax jobs

We are on v2.4

If you have the services for APM spread out over two servers, restart the doclink services located on the server with the fax software. When the server with the database is bounced, and the fax server is left running, the status messages sent from the fax server vanish...

Once the doclink services on the fax server restart, the fax status will show up in the doclink admin console.

Jeremy

--- In vantage@yahoogroups.com, Joe Rojas <jrojas@...> wrote:
>
> Hi Chris,
>
>
>
> We are using MS Fax.
>
>
>
> It’s weird because at first, it was showing why the fax failed or it had a message if the fax was successfully but now in the administrator console it’s not showing a message either way. It seemed to have just stopped returning a message.
>
>
>
> Is there any chance I could get a copy of your script? It sounds like something I could really use.
>
>
>
>
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Chris Thompson
> Sent: Monday, May 16, 2011 3:56 AM
> To: vantage@yahoogroups.com
> Subject: Re: [Vantage] APM - How to handle failed fax jobs
>
>
>
>
>
> When it fails does it give you a reason or does it give you no reason?
>
> We regularly get them where faxes fail but it gives us no reason.
>
> Are you using MS Fax?
>
> If so we have a nifty script which checks for failed faxes (tried too many times
> etc). When it detects one, it send admin an email to inform them.
>
>
>
>
>
>
>
>
>
>
>
>
> Joe Rojas | Director of Information Technology | Mats Inc
> dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
> jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring
>
>
> This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
>
>
>
> ________________________________
>
> From: Joe Rojas <jrojas@... <mailto:jrojas%40matsinc.com> >
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> Sent: Fri, 13 May, 2011 19:18:06
> Subject: [Vantage] APM - How to handle failed fax jobs
>
>
> Hello,
>
> After much help from this group, I have APM setup to send out Sales
> Order Acknowledgements.
>
> At this time, all SOA will be going out via FAX. I noticed that if the
> FAX does not get successfully sent (bad number, no answer, excessive
> busy) that I can see in the APM Administrator console that the FAX job
> failed.
>
> Is there any way to handle these failed FAX jobs? Maybe send out an
> email that it failed?
>
> Thanks.
>
> Joe Rojas | Director of Information Technology | Mats Inc
> dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
> jrojas@... <mailto:jrojas%40matsinc.com> | www.matsinc.com Ask us about our clean, green and beautiful
> matting and flooring
>
> This message is intended only for the individual named. If you are not the named
> addressee you should not disseminate, distribute or copy this e-mail. Please
> notify the sender immediately by e-mail if you have received this e-mail by
> mistake. Please note that any views or opinions presented in this email are
> solely those of the author and do not necessarily represent those of the
> company.
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>
>
> [Non-text portions of this message have been removed]
>
Hello,



After much help from this group, I have APM setup to send out Sales
Order Acknowledgements.



At this time, all SOA will be going out via FAX. I noticed that if the
FAX does not get successfully sent (bad number, no answer, excessive
busy) that I can see in the APM Administrator console that the FAX job
failed.



Is there any way to handle these failed FAX jobs? Maybe send out an
email that it failed?



Thanks.










Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring


This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.


[Non-text portions of this message have been removed]
You should be able to set up a secondary faxing solution so if the fax
does fail APM can then email it to you so you can handle it
approapriately. I believe that setting is located in the Routing List
settings.



Thanks,

Blake Clemens

IT Systems Engineer

Delmarva Millwork Corporation

(800) 360-2364 x132

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Joe Rojas
Sent: Friday, May 13, 2011 2:18 PM
To: vantage@yahoogroups.com
Subject: [Vantage] APM - How to handle failed fax jobs





Hello,

After much help from this group, I have APM setup to send out Sales
Order Acknowledgements.

At this time, all SOA will be going out via FAX. I noticed that if the
FAX does not get successfully sent (bad number, no answer, excessive
busy) that I can see in the APM Administrator console that the FAX job
failed.

Is there any way to handle these failed FAX jobs? Maybe send out an
email that it failed?

Thanks.







Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... <mailto:jrojas%40matsinc.com> | www.matsinc.com Ask
us about our clean, green and beautiful matting and flooring

This message is intended only for the individual named. If you are not
the named addressee you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately by e-mail if you have
received this e-mail by mistake. Please note that any views or opinions
presented in this email are solely those of the author and do not
necessarily represent those of the company.

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
When it fails does it give you a reason or does it give you no reason?

We regularly get them where faxes fail but it gives us no reason.

Are you using MS Fax?

If so we have a nifty script which checks for failed faxes (tried too many times
etc). When it detects one, it send admin an email to inform them.




________________________________
From: Joe Rojas <jrojas@...>
To: vantage@yahoogroups.com
Sent: Fri, 13 May, 2011 19:18:06
Subject: [Vantage] APM - How to handle failed fax jobs

Â
Hello,

After much help from this group, I have APM setup to send out Sales
Order Acknowledgements.

At this time, all SOA will be going out via FAX. I noticed that if the
FAX does not get successfully sent (bad number, no answer, excessive
busy) that I can see in the APM Administrator console that the FAX job
failed.

Is there any way to handle these failed FAX jobs? Maybe send out an
email that it failed?

Thanks.







Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful
matting and flooring

This message is intended only for the individual named. If you are not the named
addressee you should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this e-mail by
mistake. Please note that any views or opinions presented in this email are
solely those of the author and do not necessarily represent those of the
company.

[Non-text portions of this message have been removed]




[Non-text portions of this message have been removed]
Blake do you have any more info on this?




________________________________
From: Blake Clemens <blake.clemens@...>
To: vantage@yahoogroups.com
Sent: Fri, 13 May, 2011 19:32:57
Subject: RE: [Vantage] APM - How to handle failed fax jobs

Â
You should be able to set up a secondary faxing solution so if the fax
does fail APM can then email it to you so you can handle it
approapriately. I believe that setting is located in the Routing List
settings.

Thanks,

Blake Clemens

IT Systems Engineer

Delmarva Millwork Corporation

(800) 360-2364 x132

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Joe Rojas
Sent: Friday, May 13, 2011 2:18 PM
To: vantage@yahoogroups.com
Subject: [Vantage] APM - How to handle failed fax jobs

Hello,

After much help from this group, I have APM setup to send out Sales
Order Acknowledgements.

At this time, all SOA will be going out via FAX. I noticed that if the
FAX does not get successfully sent (bad number, no answer, excessive
busy) that I can see in the APM Administrator console that the FAX job
failed.

Is there any way to handle these failed FAX jobs? Maybe send out an
email that it failed?

Thanks.

Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... <mailto:jrojas%40matsinc.com> | www.matsinc.com Ask
us about our clean, green and beautiful matting and flooring

This message is intended only for the individual named. If you are not
the named addressee you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately by e-mail if you have
received this e-mail by mistake. Please note that any views or opinions
presented in this email are solely those of the author and do not
necessarily represent those of the company.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]




[Non-text portions of this message have been removed]
Hi Chris,



We are using MS Fax.



It’s weird because at first, it was showing why the fax failed or it had a message if the fax was successfully but now in the administrator console it’s not showing a message either way. It seemed to have just stopped returning a message.



Is there any chance I could get a copy of your script? It sounds like something I could really use.







From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Chris Thompson
Sent: Monday, May 16, 2011 3:56 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] APM - How to handle failed fax jobs





When it fails does it give you a reason or does it give you no reason?

We regularly get them where faxes fail but it gives us no reason.

Are you using MS Fax?

If so we have a nifty script which checks for failed faxes (tried too many times
etc). When it detects one, it send admin an email to inform them.












Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring


This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.



________________________________

From: Joe Rojas <jrojas@... <mailto:jrojas%40matsinc.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Fri, 13 May, 2011 19:18:06
Subject: [Vantage] APM - How to handle failed fax jobs


Hello,

After much help from this group, I have APM setup to send out Sales
Order Acknowledgements.

At this time, all SOA will be going out via FAX. I noticed that if the
FAX does not get successfully sent (bad number, no answer, excessive
busy) that I can see in the APM Administrator console that the FAX job
failed.

Is there any way to handle these failed FAX jobs? Maybe send out an
email that it failed?

Thanks.

Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... <mailto:jrojas%40matsinc.com> | www.matsinc.com Ask us about our clean, green and beautiful
matting and flooring

This message is intended only for the individual named. If you are not the named
addressee you should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this e-mail by
mistake. Please note that any views or opinions presented in this email are
solely those of the author and do not necessarily represent those of the
company.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]




[Non-text portions of this message have been removed]
Hi Joe

its a complicated script which I will try to explain ...

I (or my company) accept no responsibility for anything that goes wrong.

it uses powershell. (dont be scared - its just the same as a batch script
really)

Hopefully the paths wont need changing, but if they do, I have marked the parts
that need changing.

In C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog on the server where Altec is installed, create the
following files (they may be automatically created when the script runs for the
first time - but no harm in manually creating them):

outboxlogtemp.txt
outboxlog_failed.csv
outboxlog_raw.csv
outboxlog_failed_old.csv
outboxlog_failed_differences.txt
outboxlog_failed_differences.csv
outboxlog_failed_differences1.txt

There should already be a file called OutboxLOG.txt in this folder (this is an
MS Fax file).

Create a file on the server with Altec on called ParseOutbox.ps1 - save to
C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog

Paste the following in to the new file and alter paths where I have commented in
UPPER CASE:

# Part 1 - Takes outboxlog.txt and generates outboxlog_failed.csv
# This script takes the outboxlog.txt file from the Windows Server fax service
# and parses it to find faxes that did not complete. Results are dumped as a
# Web page. Normally a user can view only the status of their own faxes.
# This allows you to view failed faxes for any user.
# This script can be run as a scheduled task to provide a constantly updated
list
# Required command line in scheduled task is:
# powershell.exe "& 'C:\ProgramData\Microsoft\Windows
NT\MSFax\ActivityLog\ParseOutbox.ps1'"
# Created by Byron Wright, byron@...
# Define the file locations used.
# OutboxLog.txt from Fax Console. CHANGE THIS PATH.
$Source="C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxLog.txt"
# Copy of OutboxLox.txt from Fax Console. CHANGE THIS PATH. A TEMP FILE IS
CREATED.
$TempSource="C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlogtemp.txt"
# CSV Version of OutboxLog.txt. CHANGE THIS PATH.
$CsvDestination="C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_raw.csv"
# CSV file containing only failed faxes. CHANGE THIS PATH.
$CSVDestination1="C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed.csv"
# Not used but could export to HTML. CHANGE THIS PATH.
$HTMLDestination="C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog2.htm"

# IGNORE THE FOLLOWING UNTIL I SAY
# Import-TabDelimited function taken from The PowerShell Guy
# Source located at
http://thepowershellguy.com/blogs/posh/archive/2007/03/31/powershell-examples-used-on-ars-technica.aspx

function Import-TabDelimited ($Path) {
 gc $path |% {$header = $true} {
   if ($header){
     $h = $_.split("`t")
     $header = $false
   }
   Else {
     $r = new-object object
     $_.split("`t") |% {$i=0}{
       $r | add-Member -memberType noteProperty -name $h[$i] -value $_
       $i++
     }
     $r
   }
 }
}

#Processing the text file may lock it and cause problems on a busy fax server
#So, copy it quick.
Copy-Item -Path $Source -Destination $TempSource
#Convert to Outboxlog.txt to a csv file
Import-TabDelimited -Path $TempSource | Export-csv -Path $CsvDestination
-NoTypeInformation
#Get a list of faxes that failed by looking at the Status column
#Note that the column name includes double quote. Single quotes used to allow
that.
$BadFaxes=import-csv -Path $CsvDestination | where {$_.'"Status"' -eq
'"Transmission Error"'}
#Define Web page name
$Header="<H1>Failed Faxes</H1>"
#Dump bad faxes to an HTML file. The Select-Object cmdlet is selecting the
columns to include.
#Again note that double quotes are part of the column name.
#$BadFaxes | Select-Object
'"SubmissionTime"','"RecipientFaxNumber"','"ErrorDesc"' | ConvertTo-HTML -Body
$Header | Out-File -FilePath $HTMLDestination
$BadFaxes | Select-Object
'"SubmissionTime"','"RecipientFaxNumber"','"ErrorDesc"' | Export-csv -Path
$CsvDestination1 -NoTypeInformation

# STOP IGNORING NOW
# Step 2 - Compare the newly created csv file against the previous version from
the last time script ran
# CHANGE THE LOCATIONS BELOW. THIS COMPARE ONE FILE AGAINST ANOTHER.
$result = compare-object -syncwindow 1000 -referenceobject $(import-csv
"C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed.csv") -differenceobject $(import-csv
"C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_old.csv")
# If there are no differences end the script here
If (!$result) {exit}
# If there are differences - export the results to a new csv file
# CHANGE THE PATH BELOW
$result | foreach {$_.inputobject} | Export-CSV "C:\Documents and Settings\All
Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_differences.csv" -NoTypeInformation
$result
$resulthtml = Get-Content "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed_differences.csv"
${C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_differences.txt} = ${C:\Documents and
Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_differences.txt} -replace '"'
$resulthtml
$resulthtml |Â Out-File "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed_differences.txt"

# Remove any quote marks
# CHANGE THE PATHS BELOW
$a = Get-Content "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed_differences.csv"

$($a) |ForEach-Object {$_-replace "`"", ""} | Set-Content "C:\Documents and
Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_differences1.txt"

# Send an email to specified person with attached .txt file if there are failed
faxes
# CHANGE THE PATHS. CHANGE THE FROM AND TO EMAILS. THE PATHS MAY NEED CHANGING.
$SMTPserver = "svrmail"
$fileattachment = "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed_differences1.txt"
$from = failed-fax@yourdomain
$to = "you@yourdomain"
$subject = "Failed Fax on YOURSERVER"
#$emailbody = get-content "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\email.txt"
$emailbody = "One or more Outgoing Faxes have failed. Please see attached
document. Please go on to SVRANCIL and find out which company the fax was due
for > Check the fax number with the customer > Correct on Epicor & re-send fax >
Go into Altec and Fax Console and delete the failed fax."
$emailbody
$mailer = new-object Net.Mail.SMTPclient($SMTPserver)
$msg = new-object Net.Mail.MailMessage($from, $to, $subject, $emailbody)
$attachment = new-object Net.Mail.Attachment($fileattachment)
$msg.attachments.add($attachment)
$msg.IsBodyHTML = $true
$mailer.send($msg)

# THE PATHS MAY NEED CHANGING
# Rename the previously created csv as _old which means the next time the script
# is ran it has something to compare against
Move-Item "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed.csv" "C:\Documents
and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_old.csv" -force

To run this script you can paste the following in Start > Run (for testing
purposes):

C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe "& 'C:\Documents and
Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\parseoutbox.ps1'"

To schedule it, create a scheduled task and paste this in the 'Run' field (you
may have to change the paths):

C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe "& 'C:\Documents and
Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\parseoutbox.ps1'"

And this in the 'start in' field (you may have to change the path):

C:\WINDOWS\system32\WindowsPowerShell\v1.0

Let me know if you get stuck.

The script basically takes a snap shot of the MS Fax Outbox. Copies it, then
compare it to see any new faxes that have failed.

If it finds a new failed one it copies it to another file attached to an email.

We schedule it every ten minutes.

Thanks.




________________________________
From: Joe Rojas <jrojas@...>
To: vantage@yahoogroups.com
Sent: Mon, 16 May, 2011 14:08:49
Subject: RE: [Vantage] APM - How to handle failed fax jobs

Â
Hi Chris,

We are using MS Fax.

It’s weird because at first, it was showing why the fax failed or it had a
message if the fax was successfully but now in the administrator console it’s
not showing a message either way. It seemed to have just stopped returning a
message.

Is there any chance I could get a copy of your script? It sounds like something
I could really use.

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Chris Thompson
Sent: Monday, May 16, 2011 3:56 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] APM - How to handle failed fax jobs

When it fails does it give you a reason or does it give you no reason?

We regularly get them where faxes fail but it gives us no reason.

Are you using MS Fax?

If so we have a nifty script which checks for failed faxes (tried too many times

etc). When it detects one, it send admin an email to inform them.

Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful
matting and flooring

This message is intended only for the individual named. If you are not the named
addressee you should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this e-mail by
mistake. Please note that any views or opinions presented in this email are
solely those of the author and do not necessarily represent those of the
company.

________________________________

From: Joe Rojas <jrojas@... <mailto:jrojas%40matsinc.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Fri, 13 May, 2011 19:18:06
Subject: [Vantage] APM - How to handle failed fax jobs

Hello,

After much help from this group, I have APM setup to send out Sales
Order Acknowledgements.

At this time, all SOA will be going out via FAX. I noticed that if the
FAX does not get successfully sent (bad number, no answer, excessive
busy) that I can see in the APM Administrator console that the FAX job
failed.

Is there any way to handle these failed FAX jobs? Maybe send out an
email that it failed?

Thanks.

Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... <mailto:jrojas%40matsinc.com> | www.matsinc.com Ask us about
our clean, green and beautiful

matting and flooring

This message is intended only for the individual named. If you are not the named

addressee you should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this e-mail by
mistake. Please note that any views or opinions presented in this email are
solely those of the author and do not necessarily represent those of the
company.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]




[Non-text portions of this message have been removed]
Thanks Chris!



I’ll definitely give this a shot.



I was talking to Epicor and they are saying that APM 2.7 is almost out (maybe by the end of the month) and it supposed to have a new feature to allow you to send alerts for failed faxes. Fingers crossed.





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Chris Thompson
Sent: Tuesday, May 17, 2011 9:46 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] APM - How to handle failed fax jobs





Hi Joe

its a complicated script which I will try to explain ...

I (or my company) accept no responsibility for anything that goes wrong.

it uses powershell. (dont be scared - its just the same as a batch script
really)

Hopefully the paths wont need changing, but if they do, I have marked the parts
that need changing.

In C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog on the server where Altec is installed, create the
following files (they may be automatically created when the script runs for the
first time - but no harm in manually creating them):

outboxlogtemp.txt
outboxlog_failed.csv
outboxlog_raw.csv
outboxlog_failed_old.csv
outboxlog_failed_differences.txt
outboxlog_failed_differences.csv
outboxlog_failed_differences1.txt

There should already be a file called OutboxLOG.txt in this folder (this is an
MS Fax file).

Create a file on the server with Altec on called ParseOutbox.ps1 - save to
C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog

Paste the following in to the new file and alter paths where I have commented in
UPPER CASE:

# Part 1 - Takes outboxlog.txt and generates outboxlog_failed.csv
# This script takes the outboxlog.txt file from the Windows Server fax service
# and parses it to find faxes that did not complete. Results are dumped as a
# Web page. Normally a user can view only the status of their own faxes.
# This allows you to view failed faxes for any user.
# This script can be run as a scheduled task to provide a constantly updated
list
# Required command line in scheduled task is:
# powershell.exe "& 'C:\ProgramData\Microsoft\Windows
NT\MSFax\ActivityLog\ParseOutbox.ps1'"
# Created by Byron Wright, byron@... <mailto:byron%40conexion.ca>
# Define the file locations used.
# OutboxLog.txt from Fax Console. CHANGE THIS PATH.
$Source="C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxLog.txt"
# Copy of OutboxLox.txt from Fax Console. CHANGE THIS PATH. A TEMP FILE IS
CREATED.
$TempSource="C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlogtemp.txt"
# CSV Version of OutboxLog.txt. CHANGE THIS PATH.
$CsvDestination="C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_raw.csv"
# CSV file containing only failed faxes. CHANGE THIS PATH.
$CSVDestination1="C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed.csv"
# Not used but could export to HTML. CHANGE THIS PATH.
$HTMLDestination="C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog2.htm"

# IGNORE THE FOLLOWING UNTIL I SAY
# Import-TabDelimited function taken from The PowerShell Guy
# Source located at
http://thepowershellguy.com/blogs/posh/archive/2007/03/31/powershell-examples-used-on-ars-technica.aspx

function Import-TabDelimited ($Path) {
gc $path |% {$header = $true} {
if ($header){
$h = $_.split("`t")
$header = $false
}
Else {
$r = new-object object
$_.split("`t") |% {$i=0}{
$r | add-Member -memberType noteProperty -name $h[$i] -value $_
$i++
}
$r
}
}
}

#Processing the text file may lock it and cause problems on a busy fax server
#So, copy it quick.
Copy-Item -Path $Source -Destination $TempSource
#Convert to Outboxlog.txt to a csv file
Import-TabDelimited -Path $TempSource | Export-csv -Path $CsvDestination
-NoTypeInformation
#Get a list of faxes that failed by looking at the Status column
#Note that the column name includes double quote. Single quotes used to allow
that.
$BadFaxes=import-csv -Path $CsvDestination | where {$_.'"Status"' -eq
'"Transmission Error"'}
#Define Web page name
$Header="<H1>Failed Faxes</H1>"
#Dump bad faxes to an HTML file. The Select-Object cmdlet is selecting the
columns to include.
#Again note that double quotes are part of the column name.
#$BadFaxes | Select-Object
'"SubmissionTime"','"RecipientFaxNumber"','"ErrorDesc"' | ConvertTo-HTML -Body
$Header | Out-File -FilePath $HTMLDestination
$BadFaxes | Select-Object
'"SubmissionTime"','"RecipientFaxNumber"','"ErrorDesc"' | Export-csv -Path
$CsvDestination1 -NoTypeInformation

# STOP IGNORING NOW
# Step 2 - Compare the newly created csv file against the previous version from
the last time script ran
# CHANGE THE LOCATIONS BELOW. THIS COMPARE ONE FILE AGAINST ANOTHER.
$result = compare-object -syncwindow 1000 -referenceobject $(import-csv
"C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed.csv") -differenceobject $(import-csv
"C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_old.csv")
# If there are no differences end the script here
If (!$result) {exit}
# If there are differences - export the results to a new csv file
# CHANGE THE PATH BELOW
$result | foreach {$_.inputobject} | Export-CSV "C:\Documents and Settings\All
Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_differences.csv" -NoTypeInformation
$result
$resulthtml = Get-Content "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed_differences.csv"
${C:\Documents and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_differences.txt} = ${C:\Documents and
Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_differences.txt} -replace '"'
$resulthtml
$resulthtml | Out-File "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed_differences.txt"

# Remove any quote marks
# CHANGE THE PATHS BELOW
$a = Get-Content "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed_differences.csv"

$($a) |ForEach-Object {$_-replace "`"", ""} | Set-Content "C:\Documents and
Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_differences1.txt"

# Send an email to specified person with attached .txt file if there are failed
faxes
# CHANGE THE PATHS. CHANGE THE FROM AND TO EMAILS. THE PATHS MAY NEED CHANGING.
$SMTPserver = "svrmail"
$fileattachment = "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed_differences1.txt"
$from = failed-fax@yourdomain
$to = "you@yourdomain"
$subject = "Failed Fax on YOURSERVER"
#$emailbody = get-content "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\email.txt"
$emailbody = "One or more Outgoing Faxes have failed. Please see attached
document. Please go on to SVRANCIL and find out which company the fax was due
for > Check the fax number with the customer > Correct on Epicor & re-send fax >
Go into Altec and Fax Console and delete the failed fax."
$emailbody
$mailer = new-object Net.Mail.SMTPclient($SMTPserver)
$msg = new-object Net.Mail.MailMessage($from, $to, $subject, $emailbody)
$attachment = new-object Net.Mail.Attachment($fileattachment)
$msg.attachments.add($attachment)
$msg.IsBodyHTML = $true
$mailer.send($msg)

# THE PATHS MAY NEED CHANGING
# Rename the previously created csv as _old which means the next time the script
# is ran it has something to compare against
Move-Item "C:\Documents and Settings\All Users\Application
Data\Microsoft\Windows NT\MSFax\ActivityLog\outboxlog_failed.csv" "C:\Documents
and Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\outboxlog_failed_old.csv" -force

To run this script you can paste the following in Start > Run (for testing
purposes):

C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe "& 'C:\Documents and
Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\parseoutbox.ps1'"

To schedule it, create a scheduled task and paste this in the 'Run' field (you
may have to change the paths):

C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe "& 'C:\Documents and
Settings\All Users\Application Data\Microsoft\Windows
NT\MSFax\ActivityLog\parseoutbox.ps1'"

And this in the 'start in' field (you may have to change the path):

C:\WINDOWS\system32\WindowsPowerShell\v1.0

Let me know if you get stuck.

The script basically takes a snap shot of the MS Fax Outbox. Copies it, then
compare it to see any new faxes that have failed.

If it finds a new failed one it copies it to another file attached to an email.

We schedule it every ten minutes.

Thanks.












Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring


This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.



________________________________

From: Joe Rojas <jrojas@... <mailto:jrojas%40matsinc.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Mon, 16 May, 2011 14:08:49
Subject: RE: [Vantage] APM - How to handle failed fax jobs


Hi Chris,

We are using MS Fax.

It’s weird because at first, it was showing why the fax failed or it had a
message if the fax was successfully but now in the administrator console it’s
not showing a message either way. It seemed to have just stopped returning a
message.

Is there any chance I could get a copy of your script? It sounds like something
I could really use.

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On Behalf Of
Chris Thompson
Sent: Monday, May 16, 2011 3:56 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] APM - How to handle failed fax jobs

When it fails does it give you a reason or does it give you no reason?

We regularly get them where faxes fail but it gives us no reason.

Are you using MS Fax?

If so we have a nifty script which checks for failed faxes (tried too many times

etc). When it detects one, it send admin an email to inform them.

Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... <mailto:jrojas%40matsinc.com> | www.matsinc.com Ask us about our clean, green and beautiful
matting and flooring

This message is intended only for the individual named. If you are not the named
addressee you should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this e-mail by
mistake. Please note that any views or opinions presented in this email are
solely those of the author and do not necessarily represent those of the
company.

________________________________

From: Joe Rojas <jrojas@... <mailto:jrojas%40matsinc.com> <mailto:jrojas%40matsinc.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
Sent: Fri, 13 May, 2011 19:18:06
Subject: [Vantage] APM - How to handle failed fax jobs

Hello,

After much help from this group, I have APM setup to send out Sales
Order Acknowledgements.

At this time, all SOA will be going out via FAX. I noticed that if the
FAX does not get successfully sent (bad number, no answer, excessive
busy) that I can see in the APM Administrator console that the FAX job
failed.

Is there any way to handle these failed FAX jobs? Maybe send out an
email that it failed?

Thanks.

Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... <mailto:jrojas%40matsinc.com> <mailto:jrojas%40matsinc.com> | www.matsinc.com Ask us about
our clean, green and beautiful

matting and flooring

This message is intended only for the individual named. If you are not the named

addressee you should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this e-mail by
mistake. Please note that any views or opinions presented in this email are
solely those of the author and do not necessarily represent those of the
company.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]




[Non-text portions of this message have been removed]