< Back

Remove-OMSSavedSearch

Sat Jan 18, 2020 5:50 pm

NAME Remove-OMSSavedSearch



SYNOPSIS

Deletes OMS Saved Search.





SYNTAX

Remove-OMSSavedSearch [-Token] <String> [-SubscriptionID] <String> [-ResourceGroupName] <String>

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



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

[<CommonParameters>]





DESCRIPTION

Deletes OMS Saved Search. Deleted saved search

does not immediately dissappears from OMS portal.

It may take a couple of minutes until it dissappears.





PARAMETERS

-Token <String>

Token aquired from Get-AADToken cmdlet.



Required? true

Position? 1

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? 2

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



-QueryName <String>

Specify the full name of OMS Saved Search to get

only specific query.



Required? true

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? 6

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

No Output.

]





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



PS C:\\>Remove-OMSSavedSearch -SubscriptionID $subscriptionId -ResourceGroupName $ResourceGroupName

-OMSWorkspaceName $OMSWorkspace -Token $Token -QueryName 'SavedQueryName'



Description

-----------

Removes specific Saved Search by name 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 2 --------------------------



PS C:\\>Remove-OMSSavedSearch -SubscriptionID $subscriptionId -ResourceGroupName $ResourceGroupName

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



Description

-----------

Removes specific Saved Search by name 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 3 --------------------------



PS C:\\>Remove-OMSSavedSearch -OMSConnection $OMSCon -Token $Token -QueryName 'SavedQueryName'



Description

-----------

Removes specific Saved Search by name 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 4 --------------------------



PS C:\\>Remove-OMSSavedSearch -OMSConnection $OMSCon -Token $Token -QueryName 'SavedQueryName' -APIVersion

'2015-03-20'



Description

-----------

Removes specific Saved Search by name from OMS by using information from asset of type connection in OMS

Automation

Uses specific version of Operational Insights API



Example Variables

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

$OMSCon = Get-AutomationConnection -Name 'OMSCon'

$Token = Get-AADToken -OMSConnection $OMSCon











RELATED LINKS