Sending Status Messages by Email

I am using Status Filter Rules to send warning and error messages via email from several CM07 sites. The process hasn't been consistent.

Messages created by the SMS_Distribution_Manager do not send the entire description field where other components do. I have not been able to figure it out.

I have tried using vbscript and powershell, both give the same results.

Here is what I am doing for distribution manager emails via vbscript.

cscript.exe "C:\Scripts\sendMail.vbs" "myemailaaddress" "%msgdesc"

SendMail.vbs contents:

Const SMTPServer = "IP Address of SMTP Server" ' SMTP server IP address
Const From = "From Address"
Const Subject = "SCCM Package Alert"

Set objArgs = WScript.Arguments
If objArgs.count < 2 Then
 ' All arguments are required
 WScript.Quit(1)
Else
 SendGenericMail objArgs(0), objArgs(1)
End If

Sub SendGenericMail (sTo, sMessage)
 On Error Resume Next
 ' Generate TO and CC recipients based on number of e-mail addresses provided.
 If instr(sTo,";") > 1 Then
  sTo_array = Split(sTo,";")
  kokku = UBound(sTo_array)
  For i = 1 to kokku
   If i <> kokku Then
    CCstring = CCstring & sTo_array(i) & ", "
   Else
    CCstring = CCstring & sTo_array(i)
   End If
  Next
  TOstring = sTo_array(0)
 Else
  TOstring = trim(sTo)
 End If

 Set CDO = WScript.CreateObject("CDO.Message")
 CDO.From = From
 CDO.To = TOstring
 CDO.Cc = CCstring
 CDO.Subject = Subject
 CDO.TextBody = sMessage
 CDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
 CDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
 CDO.Configuration.Fields.Update

 CDO.Send
End Sub

Here is an example of the email body then the full message detail.

Email Body:

SMS Distribution Manager failed to process package Law

Here is the full message detail:

SMS Distribution Manager failed to process package "Law Civil Image" (package ID = DIT007A9).

Possible cause: Distribution manager does not have access to either the package source directory or the distribution point.
Solution: Verify that distribution manager can access the package source directory/distribution point.

Possible cause: The package source directory contains files with long file names and the total length of the path exceeds the maximum length supported by the operating system.
Solution: Reduce the number of folders defined for the package, shorten the filename, or consider bundling the files using a compression utility.

Possible cause: There is not enough disk space available on the site server computer or the distribution point.
Solution: Verify that there is enough free disk space available on the site server computer and on the distribution point.

Possible cause: The package source directory contains files that might be in use by an active process.
Solution: Close any processes that maybe using files in the source directory.  If this failure persists, create an alternate copy of the source directory and update the package source to point to it.

Email messages from other component sources have the complete description field.

Can someone tell me what I am doing wrong or what I might be missing?

Thanks,

Steve

June 21st, 2013 8:48pm

Hi,

You may refer to the following links to check if they help:

Sending SCCM Status Messages from MDT Scripts.

Send SCCM task sequence email report

Regards,

Sabrina

Free Windows Admin Tool Kit Click here and download it now
June 25th, 2013 7:55am

Hello Sabrina.

Thank you for replying. The first link doesn't appear to be related. The second link is one I used to craft a PowerShell script for sending the emails. It does work well for sending email, but doesn't resolve my issue.

What I need to resolve is the fact that SMS Distribution Manager source alerts only send partial details where all other sources send complete details.

Steve

June 26th, 2013 2:08pm

Yes, I know this is an old post, but Im trying to clean them up. Did you solve this problem, if so what was the solution?

Free Windows Admin Tool Kit Click here and download it now
March 14th, 2015 10:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics