IT Monkey will place code here as examples of what Cireson's consulting team has to offer as well as examples for public consumption to benefit the Microsoft System Center community as a whole.
DISCLAIMER
All files and projects located here come as is and without any warranty or support. We will attempt to improve the projects as time goes on based on customer and community demand. Comments and improvements are welcome as well as customization requests. Your use of these Cireson Uploads is subject to our Terms of Use.
Cireson's support team has no information on these projects outside of what you have available and will not provide support for these enhancements, extensions, and scripts.
Dont forget to checkout solutions uploaded by our customers, partners and community members here.
PowerShell Version of Action Log Notify
Anyone else find that Action Log Notify can be a bit frustrating to configure especially when you want to try and do something clever like use a different email template depending on the Work Item type.
Here's a PowerShell based version which gives you super flexibility. I've chucked in a sample HTML email template but insert your own to match the rest of your notifications.
You can trigger it in any Automation platform, Orchestrator is nice and easy as it provides an OOB activity to Monitor for new Comments. You can set your runbook up like this.
And configure the Monitor Object like this
Don't forget to include the filter to only trigger on Non-Private comments!!!
Then add the attached PowerShell into the Run .Net Script and link the two by passing in the SCObjectGuid of the Comment into the first line of the PowerShell.
Hope you like this and find it helpful. Please post some examples of the cool html emails I know you guys will create for this.
Geoff
Comments
On the other side, in the near future you should see action log notify incorporated into Notify Analyst to make configuration easier, and streamline the experience.
Until then, great work Geoff!
How would you go about setting up a monitor for Support Group changes? Notify Analyst doesn't work for us because we're running on multiple domains and members cannot be enumerated. Moving this to PowerShell may be the answer.
We have a script to check the last history entry of a WI to determine whether a field changed, but we'd still need to run a monitor on New or Updated SRs, which is horribly inefficient.
Great work! Just a heads up, in your text you mention:
But I think you try to mention to only trigger on non-Private comments.
I think everybody understands what you mean, but you aren't stating it.
I'm going to try this soon, any indication when we can expect an update of the Notify Analyst product?
The term 'Get-SCSMObject' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Is it something I've edited wrong, or do I need to do something extra?
I've loaded smlets now and set the SM Computer, but I'm still getting an error "The Data Access service is either not running or not yet initialized. Check the event log for more information."
Is there a simple way to call the default PS connection in a runbook? As there seems to have been one configured in our environment (by previous colleagues)
I had researched about the -computername and was instead using the command:
$SMDefaultComputer = "SCSMservename.domain.uk"
But I had that above the Import-module!
Getting there now!
Attached a tweaked version of @Geoff_Ross 's script to Notify Assigned To Analyst, when a call is updated by another analyst - related to this post: https://community.cireson.com/discussion/comment/5559
I've not included any filters on the comment visibility on my runbook as it's for Analysts so will need private and visible alerts.
This is purely for reference, I'm new to PowerShell, so no guarantees regarding any of the outcomes!
I've been trying to do this with the SR actionlog and IR actionlog.
Is Trouble Ticket Analyst Comment also what is used for Service Requests as actionlog, even though it's called Trouble Ticket?
@fe_fe Yes it works for both.
I'm having a small issue with mine, where every so often it can't load the SMLets module. It errors with the below, and after a few hours and several failures it just starts working again!
The module to process 'SMLets.psm1', listed in field 'ModuleToProcess' of module manifest 'C:\Common Files\SMLets\SMLets.psd1' was not processed because no valid module was found in any module directory.
I have referenced the module directly in my script now, with "Import-module "C:\Common Files\SMLets" -Force" but it still fails.
Any tips anyone? I suspect it may just be our environment, but any clues would be helpful.
Thanks.
Is it from Orchestrator?
I've never had any issues like that.
Have you installed SMLets properly on your Orchestrator Runbook server?
http://cireson.com/blog/installing-smlets-on-system-center-orchestrator-2012-server-without-a-management-server/
Hi @fe_fe
Yes it's Orchestrator, I fully expect its an issue with how it's installed as you've sent through. I'll keep my eye on it as it is very infrequent. There may be some sort of pattern.
Thanks for your advice.
When is the near future?
@Leigh_Kilday for Support group change we use 2 runbooks monitoring SR/IR updates which call another runbook handling the actual change. What's wrong with this? Did you manage to create a better solution for support group changes? Thanks.