< Back

Get-OMSSavedSearch

Sat Jan 18, 2020 5:49 pm

NAME Get-OMSSavedSearch



SYNOPSIS

Gets Saved Searches from OMS workspace





SYNTAX

Get-OMSSavedSearch [-Token] <String> [-SubscriptionID] <String> [-ResourceGroupName] <String> [-OMSWorkspaceName]

<String> [[-QueryName] <String[]>] [[-APIVersion] <String>] [<CommonParameters>]



Get-OMSSavedSearch [-Token] <String> [-OMSConnection] <Object> [[-QueryName] <String[]>] [[-APIVersion] <String>]

[<CommonParameters>]





DESCRIPTION

Gets Saved Searches from OMS workspace





PARAMETERS

-Token <String>

Token aquired from Get-AADToken cmdlet.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SubscriptionID <String>

Azure Subscription ID where the OMS workspace

is located.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ResourceGroupName <String>

Azure Resource Group Name where the OMS

workspace is located.



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-OMSWorkspaceName <String>

Name of the OMS workspace.



Required? true

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-OMSConnection <Object>

Object that contains all needed parameters for working

with OMSSearch Module. You can create such object in

OMS Automation as connection asset.



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-QueryName <String[]>

Specify the full name of OMS Saved Search to get

only specific query. Array of saved search names

can be specified as well.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-APIVersion <String>

Api version for microsoft.operationalinsights

Azure Resource provider.



Required? false

Position? 5

Default value 2015-03-20

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Object. Returns array of objects. Each object

is saved search query. If no saved searches are found

error is returned.





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$OMSSS=Get-OMSSavedSearch -SubscriptionID $subscriptionId -ResourceGroupName $ResourceGroupName

-OMSWorkspaceName $OMSWorkspace -Token $Token



Description

-----------

Gets Saved Searches from OMS



Example Variables

-----------------

$OMSCon = Get-AutomationConnection -Name 'OMSCon'

$Token = Get-AADToken -OMSConnection $OMSCon

$subscriptionId = "3c1d68a5-4064-4522-94e4-e0378165555e"

$ResourceGroupName = "oi-default-east-us"

$OMSWorkspace = "Test"



Example Output

--------------

$OMSSS[0].ID

$OMSSS[0].etag

$OMSSS[0].properties

$OMSSS[0].properties.Category

$OMSSS[0].properties.DisplayName

$OMSSS[0].properties.Query

$OMSSS[0].properties.Version









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>$OMSSS=Get-OMSSavedSearch -SubscriptionID $subscriptionId -ResourceGroupName $ResourceGroupName

-OMSWorkspaceName $OMSWorkspace -Token $Token -APIVersion '2015-03-20'



Description

-----------

Gets Saved Searches from OMS.

Uses specific version of Operational Insights API



Example Variables

-----------------

$OMSCon = Get-AutomationConnection -Name 'OMSCon'

$Token = Get-AADToken -OMSConnection $OMSCon

$subscriptionId = "3c1d68a5-4064-4522-94e4-e0378165555e"

$ResourceGroupName = "oi-default-east-us"

$OMSWorkspace = "Test"



Example Output

--------------

$OMSSS[0].ID

$OMSSS[0].etag

$OMSSS[0].properties

$OMSSS[0].properties.Category

$OMSSS[0].properties.DisplayName

$OMSSS[0].properties.Query

$OMSSS[0].properties.Version









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>$OMSSS = Get-OMSSavedSearch -OMSConnection $OMSCon -Token $Token



Description

-----------

Gets Saved Searches from OMS by using information from asset of type connection in OMS Automation



Example Variables

-----------------

$OMSCon = Get-AutomationConnection -Name 'OMSCon'

$Token = Get-AADToken -OMSConnection $OMSCon



Example Output

--------------

$OMSSS[0].ID

$OMSSS[0].etag

$OMSSS[0].properties

$OMSSS[0].properties.Category

$OMSSS[0].properties.DisplayName

$OMSSS[0].properties.Query

$OMSSS[0].properties.Version









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>$OMSSS = Get-OMSSavedSearch -OMSConnection $OMSCon -Token $Token -QueryName 'SavedQueryName'



Description

-----------

Gets specific Saved Search from OMS by using information from asset of type connection in OMS Automation



Example Variables

-----------------

$OMSCon = Get-AutomationConnection -Name 'OMSCon'

$Token = Get-AADToken -OMSConnection $OMSCon



Example Output

--------------

$OMSSS[0].ID

$OMSSS[0].etag

$OMSSS[0].properties

$OMSSS[0].properties.Category

$OMSSS[0].properties.DisplayName

$OMSSS[0].properties.Query

$OMSSS[0].properties.Version









-------------------------- EXAMPLE 5 --------------------------



PS C:\\>$OMSSS = Get-OMSSavedSearch -OMSConnection $OMSCon -Token $Token -QueryName

'SavedQueryName1','SavedQueryName2'



Description

-----------

Gets specific Saved Searches from OMS by using information from asset of type connection in OMS Automation



Example Variables

-----------------

$OMSCon = Get-AutomationConnection -Name 'OMSCon'

$Token = Get-AADToken -OMSConnection $OMSCon



Example Output

--------------

$OMSSS[0].ID

$OMSSS[0].etag

$OMSSS[0].properties

$OMSSS[0].properties.Category

$OMSSS[0].properties.DisplayName

$OMSSS[0].properties.Query

$OMSSS[0].properties.Version











RELATED LINKS