You could setup a Data Analytic's DTS Rule under Calculate Data.
Something like this:
*Update: I forgot one line in the script above, you need it to end with the following line after the End If:
RetValue = !Computer.Display Name!
Update the "hostname" to the name of the system.
Then create a PowerShell script at C:\email.ps1 that contains whatever information you want to be sent in the email, the script will pass the currently being processed hostname in as a parameter to the script in case you create multiple hostnames to monitor.
Sending emails via PowerShell: Send-MailMessage
*Note: the Computer.Display Name will not actually be affected, it just triggers the DTS rule any time an inventory scan comes in with that data. Which all scans should contain. This should work for systems both in band and going through the CSA.
Hope this helps,
I am giving it a try now with a test machine. Thanks for the advice and I will let you know once the piloting finished.
One thing I forgot to
mention is that real time processing needs to be on as well as setting that rule you create as active.
I don't seem to be having any luck so far. I have set up the rule to test my computer when it runs an inventory scan and I do not receive any email. I have run the powershell script manually to test and it succeeds so I believe the issue resides in DA and the rules. Do you have any other suggestions?
You have real time processing enabled?
You have also right clicked on the rule and set it active?
It also looks like I didn't add a new line between the two vbscript commands:
Set objShell = CreateObject("Wscript.Shell") objShell.run("powershell.exe -ep bypass -noexit -file c:\email.ps1 " & !Computer.Display Name!)
Set objShell = CreateObject("Wscript.Shell")
objShell.run("powershell.exe -ep bypass -noexit -file c:\email.ps1 " & !Computer.Display Name!)
That might be the problem. Sorry!
I have double checked those two settings and toggled them both to see if that would bump it. I did make the change to the code and we shall see if that works. Thanks for your help and stay tuned, I will post soon with results!
I am having to correct a database and reporting issue at the moment. When I ran one of the variations of the above rules, it truncated a lot of the Device Name information. Not sure why.... I'll be back with you soon.