14 users responded in this post

Subscribe to this post comment rss or trackback url
User Gravatar
bizzarro said in June 2nd, 2010 at 10:42 am

i’ve set up a status alert like you said with the script but it doesn’t run it. I changed it to look for the message ID only 10008 for completed successfully.

I configured the script and ran the command line manually and it works. But after the job runs successfully it never runs the other program.

Is there anything I need to look at or if there’s a log I can view to see on why it didn’t run.

VA:F [1.9.17_1161]
Rating: 5.0/5 (1 vote cast)
User Gravatar
danovich said in June 3rd, 2010 at 5:22 pm

bizzarro, I was also having inconsistent resulting using the powershell script, so I’ve re-written it with VBScript and is as follows:

‘START VBS

Dim sComputerName
Set args = WScript.Arguments
sComputername = args.Item(0)

Set objMessage = CreateObject(“CDO.Message”)
objMessage.Subject = “SCCM OS deployment failed for ” & sComputername
objMessage.From = “sender@domain.com”
objMessage.To = “recepient@domain.com”
objMessage.TextBody = sComputername &” has failed a task sequence”

‘==This section provides the configuration information for the remote SMTP server.
‘==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/sendusing”) = 2

‘Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/smtpserver”) = “mail.domain.com”

‘Server port (typically 25)
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/smtpserverport”) = 25

objMessage.Configuration.Fields.Update

‘==End remote SMTP server configuration section==

objMessage.Send

‘ END VBS

The action for the status filter rule is “CSCRIPT.EXE D:\SCRIPTS\email.vbs %msgsys” with Message ID as “11170″ and Component as “Task Sequence Manager”

VN:F [1.9.17_1161]
Rating: 5.0/5 (2 votes cast)
User Gravatar
bizzarro said in June 5th, 2010 at 4:50 am

Actually the problem was that I can’t use it as a command line within the Actions tab. I put the command line into a .cmd file to run after the job is done. That works, but the %msgsys doesn’t seem to be working. It says “msgsys” rather than the computer name from what I read in the documentation on the command lines.

Thanks,

Harvey

VA:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
danovich said in June 7th, 2010 at 3:23 pm

Have you tried just using ‘CSCRIPT.EXE D:\SCRIPTS\email.vbs %msgsys’. I am sure this works. If you start using batch files you will lose the parameters that are being fed into the command.

VN:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
bizzarro said in June 18th, 2010 at 9:03 am

Sorry, I was referring to your original Powershell script when I ran that command.

I just piece together one in VB from another code I found online, should of just came here instead to use yours. The only problem I have in my VBscript is that I can’t set the argument to the strComputer variable. It says object or method not supported Item. If I leave the argument as is and use that as the variable it works fine. For this case I only need one argument but wonder why other posted scripts work allow people to set the variable?

Thanks.

VA:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
bizzarro said in June 18th, 2010 at 9:06 am

I have it working like your script and see where the error is in theirs. They reversed the objARgs.Item(0)= StrComputer instead of StrComputer = ojbArgs.Item(0) like you have it. That resolved that issues and now I have it working, thanks.

Harvey

VA:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
alexandh said in December 18th, 2010 at 1:45 am

I am trying to implement this, but it is not working. If I run the from a command prompt, it goes thru, so my setup in the status filter rule must be incorrect. I had to type in “task sequence manager” for the component, as it was not available as a drop down. Running SCCM R3. Any ideas?

VA:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
tpullins said in February 9th, 2011 at 5:20 am

I also do not see Task Sequence Manager in the Component drop down list… SCCM 2007 R2

VA:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
McRaae said in February 27th, 2011 at 8:32 pm

I am also trying to implement this, but do not see “Task Sequence Manager” in the Component drop down list. I typed it manualy, byt it dosn’t seem to be working. I have a lot of TS errors but no mail. I have teste the mail script manualy and it works.

SCCM 2007 R2

VA:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
Tronni said in October 25th, 2011 at 7:21 pm

I’ve have the same issue as above. I cant find “Task Sequence Manager” in the drop down list.

VA:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
danovich said in November 2nd, 2011 at 10:30 am

Just type it in manually…

VN:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
Napandee said in February 28th, 2012 at 5:36 am

Hello!

First of all thanks works like a charm :)

However in my SCCM the script sends multiple emails for the same client?

Sometimes it can be 2mins between them and sometimes around 30mins.

Any idea what to look for?

Keep up the good work!

VA:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
Napandee said in February 28th, 2012 at 6:28 am

Ofc about 1h after I posted I found the “problem”

The status filtering rule is doing as it’s been told! It searches for the success code 11171 but imagen if you install some software via TS besides the OSD…..

I modified my status filtering rule to search for my Windows 7 installation OSD package ID and then the spam stopped :)

Hope this helps some1!

VA:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
User Gravatar
danovich said in February 28th, 2012 at 4:30 pm

Good news Napandee thanks for the feedback

VN:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
Leave A Reply

 Username (Required)

 Email Address (Remains Private)

 Website (Optional)