Get-SqlMonitorMonitoredObject
Published 16 June 2023
Gets the details of all of the monitored objects in SQL Monitor.
Syntax
Get-SqlMonitorMonitoredObject [-BaseMonitor <BaseMonitor>] [-Type <MonitoredObjectType>] [-Name <string>] [<CommonParameters>] Get-SqlMonitorMonitoredObject [-Type <MonitoredObjectType>] [-Name <string>] [-Parent <MonitoredObject>] [<CommonParameters>] Get-SqlMonitorMonitoredObject [-Type <MonitoredObjectType>] [-Name <string>] [-Group <Group>] [<CommonParameters>]
Description
The Get-SqlMonitorMonitoredObject cmdlet gets details of SQL Monitor Monitored objects from the SQL Monitor Server.
Connect-SqlMonitor must be called before this cmdlet.
Parameters
-BaseMonitor
<BaseMonitor>
The Base Monitor to limit results to.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | True (ByValue) |
Accept Wildcard Characters | false |
-Type
<MonitoredObjectType>
The type of object to limit results to. One of SqlServerInstance, AzureManagedInstance, AzureSqlServer, PostgresInstance, AmazonRdsHost, AmazonAuroraCluster, Cluster or Machine.
SqlServerInstance will return the details of SQL Server instances running on self-managed operating systems such as Windows or Linux. AzureManagedInstance will return the details of Azure SQL Managed Instances. AzureSqlServer will return the details of servers that host Azure SQL Databases. PostgresInstance will return the details of Postgres servers running on either a Linux host or in Amazon RDS. AmazonRdsHost will return the details of Amazon RDS hosts for both Postgres and SQL Server. AmazonAuroraCluster will return details of Amazon RDS hosts configured as part of an Aurora cluster. Cluster will return details of Windows Server Failover Clusters. Machine will return details of individual Windows and Linux machines.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-Name
<String>
The name of a monitored object to match.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-Parent
<MonitoredObject>
{{ Fill Parent Description }}
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | True (ByValue) |
Accept Wildcard Characters | false |
-Group
<Group>
{{ Fill Group Description }}
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | True (ByValue) |
Accept Wildcard Characters | false |
-ProgressAction
<ActionPreference>
{{ Fill ProgressAction Description }}
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
[BaseMonitor] For more information, see https://www.red-gate.com/SM13/powershell-custom-types#CustomTypes-BaseMonitor.
-
[Type] For more information, see https://www.red-gate.com/SM13/powershell-custom-types#CustomTypes-MonitoredObjectType.
-
[Parent] Optional: restrict results to monitored objects with the given parent.
-
[Group] Optional: restrict results to monitored objects within the given group.
Return values
The output type is the type of the objects that the cmdlet emits.
-
[Cluster] For more information, see https://www.red-gate.com/SM13/powershell-custom-types#CustomTypes-Cluster.
-
[Machine] For more information, see https://www.red-gate.com/SM13/powershell-custom-types#CustomTypes-Machine.
-
[LinuxMachine] For more information, see https://www.red-gate.com/SM13/powershell-custom-types#CustomTypes-LinuxMachine.
-
[AzureSqlServer] For more information, see https://www.red-gate.com/SM13/powershell-custom-types#CustomTypes-AzureSqlServer.
-
[AzureManagedInstance] For more information, see https://www.red-gate.com/SM13/powershell-custom-types#CustomTypes-AzureManagedInstance.
-
[AmazonRdsSqlServer] For more information, see https://www.red-gate.com/SM13/powershell-custom-types#CustomTypes-AmazonRdsSqlServer.
-
[AmazonRdsHost] For more information, see https://www.red-gate.com/SM13/powershell-custom-types#CustomTypes-AmazonRdsHost.
-
[PostgresInstance] For more information, see https://www.red-gate.com/SM13/powershell-custom-types#CustomTypes-PostgresInstance.
Examples
-------------------------- EXAMPLE 1 --------------------------
Get-SqlMonitorMonitoredObject
-------------------------- EXAMPLE 2 --------------------------
Get-SqlMonitorMonitoredObject -Type Cluster Get-SqlMonitorMonitoredObject -Type Machine Get-SqlMonitorMonitoredObject -Type PostgresInstance
-------------------------- EXAMPLE 3 --------------------------
Get-SqlMonitorMonitoredObject -BaseMonitor $baseMonitor
-------------------------- EXAMPLE 4 --------------------------
Get-SqlMonitorMonitoredObject -Name "ExampleName"
-------------------------- EXAMPLE 5 --------------------------
Get-SqlMonitorMonitoredObject -BaseMonitor $baseMonitor -Name "ExamplePostgresInstanceName" -Type PostgresInstance
-------------------------- EXAMPLE 6 --------------------------
$host = Get-SqlMonitorMonitoredObject -Type Machine -Name "ExampleMachineName" Get-SqlMonitorMonitoredObject -Parent $host -Type Instance
-------------------------- EXAMPLE 7 --------------------------
#Equivalent to above Get-SqlMonitorMonitoredObject -Type Machine -Name "ExampleMachineName" | Get-SqlMonitorMonitoredObject -Type SqlServerInstance
-------------------------- EXAMPLE 8 --------------------------
Get-SqlMonitorGroup -Name "1 - Production" | Get-SqlMonitorMonitoredObject