Status filter rules has been around for ages so that's not what this post is about. This post is about using the same functionality but whenever you want to by sending a MessageID of your choice, customizing the information sent and using that information as arguments to a command.
Most rules I’ve seen have been triggered by a fail or success event during a sequence and has been used to send or create some kind of report of the outcome.
Event Fail=11170
Event Succeeded=11171
The commandline for the script could look like this:
“TSOutcome.vbs /ComputerName:%msgsys /ProgramSuccess:Yes”
Useful? Sure, but very limited and %msgsys is a predefined variable.
Status message variables: https://docs.microsoft.com/en-us/previous-versions/system-center/configuration-manager-2007/bb693758(v=technet.10)
But what if you want to do something else in the middle of an OSD, like setting variables to the Computer-Resource running the TS?
Well, you can.
There are a number of tools out there that can help you.
StatGen by 2Pint Software (although it’s not working too well in WinPE with multiple MP’s) and the tool we use, OneVinn’s SCCM Console Extension which is great, just to mention two.
So went back and took a look at some stuff I played around with some time ago and here’s the result.
This command:
With this rule:
Will look like this in the log:
But the strings will still be passed to the command and this is the result:
https://github.com/MattiasC85/Send-CMMessage
And please think about security, escape characters etc, and try to use named arguments if you decide to use this method.
If you can trigger a script from a computer in WinPE and even before starting the TS, anyone can!
“-MP” needs to be set if running outside a TS or if the computer hasn’t got the Advanced client installed (Not tested)
If you just want to write something custom in the log then just leave the messageID alone and pass some insertionsstrings as arguments, the default prop-textfile will do the rest :)
This doesn't seem to work for me in a HTTPS only environment.
I was able to figure out that we need to add a SSLCert (I added encryption just to be sure):
Lines 134 - 137 & 231 - 232. Now the authentication was working on the IIS but the server still rejected the message (from MP_Status.log):
Mp Status: processing event: MpEvent_ClientAuth_SignatureFailure, for machine: <SCCM Server Name here>
Interestingly it shows the SCCM server name and not the client name.
If I change the sender from Http.HttpSender to Ccm.CcmSender it works again without changes (Lines 183 & 184). But this then probably breaks functionallity in WinPE as CcmSender requires an installed client.
Do you know the solution to this problem?
You just needed to import the additional dll that's included in the nuget package. :)
Hi. Thanks for the comment and for letting me know that it doesn't work any longer. Been busy deploying 1909 without peer advantages and got a corrupt sccm upgrade on my hands but I'll look at it asap. Regards //Mattias
Hi someguy100
I hope you are well. Hou have written a great blog about Create a custom status message. I have only a quick question. Is there a possibility to use the new Microsoft.ConfigurationManagement.Messaging.dll version (5.1902.1006.1000 - https://www.nuget.org/packages/Microsoft.ConfigurationManagement.Messaging/5.1902.1006.1000) ? Only the file replace doesn't work...
Best Regards,
Daniel