6 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.3_1094]
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.3_1094]
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.3_1094]
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.3_1094]
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.3_1094]
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.3_1094]
Rating: 0.0/5 (0 votes cast)
Leave A Reply

 Username (Required)

 Email Address (Remains Private)

 Website (Optional)