OMSSearch Module Sample Runbook: Invoke-OMSSavedSearch

Over the last few days, I’ve been playing with the OMSSearch PowerShell / SMA / Azure Automation Module my friend and fellow SCCDM MVP Stanislav Zhelyazkov has created.

I am now part of this project on Github and have become the 3rd contributor (after Stan and Stefan Stranger). The module was updated yesterday (version 5.1.1) with some of my updates.

Today, I have written a sample runbook: Invoke-OMSSavedSearch. As the name suggests, it performs a user defined saved search.

Note: due to the limitation of the OMS Search API, we can only retrieve the user defined saved searches. Therefore you cannot use this runbook for any built-in saved searches in OMS.

Runbook:

This runbook expects 3 input parameters:

image

  • OMSConnectionName: the name of the OMS Connection object defined in SMA or Azure Automation
  • SavedSearchCategory: the saved search category you specified when you saved the search query
  • SavedSearchName: the display name of the saved search you specified when you saved the search query

SNAGHTML23f6a166

Runbook Result in SMA:

SNAGHTML23f938da

Same event in OMS:

image

Pre-Requisite:

This runbook is written based on version 5.1.1 of the OMSSearch Module. It will not work with the previous versions because I have added few additional paramters in the OMSConnection object which are used by this runbook.

One comment

Leave a Reply

%d bloggers like this: