Add-SqlMonitorMonitoredObject
Published 14 February 2023
Adds the given monitored object to SQL Monitor.
Syntax
Add-SqlMonitorMonitoredObject -MonitoredObject <Object> [<CommonParameters>] Add-SqlMonitorMonitoredObject -MonitoredObject <Object> -BaseMonitor <BaseMonitor> [-Group <Object>] [-WindowsUserName <string>] [-WindowsPassword <string>] [-SqlServerAuthenticationMode <string>] [-SqlServerUserName <string>] [-SqlServerPassword <string>] [-NetworkProtocol <string>] [-SqlServerPort <int>] [-PacketSize <int>] [-ConnectionTimeout <int>] [-ExecutionTimeout <int>] [-EncryptConnection <bool>] [-AutoDetectClusterName <bool>] [-WmiType <string>] [-TrustServerCertificate <bool>] [-Type <string>] [-Alias <string>] [<CommonParameters>]
Description
The Add-SqlMonitorMonitoredObject cmdlet adds Amazon RDS SQL Servers, Azure SQL Databases, Azure SQL Servers, Azure Managed Instances, Clusters and Monitored Machines, and SQL Servers on Linux machines to a SQL Monitor server.
Parameters
-MonitoredObject
<Object>
Definitions of the monitored objects to be created, as returned by the `New-...` cmdlets (i.e. New-SqlMonitorWindowsHost, New-SqlMonitorPostgreSql, etc.) Previously, now deprecated: The address of the monitored object e.g. "localhost".
Aliases | None |
Required? | true |
Position? | named |
Default Value | None |
Accept Pipeline Input | True (ByValue) |
Accept Wildcard Characters | false |
-BaseMonitor
<BaseMonitor>
The base monitor to add the monitored object to. For more informatiom, see https://documentation.red-gate.com/sm/api/powershell-cmdlet-reference/get-sqlmonitorbasemonitor.
Aliases | None |
Required? | true |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-Group
<Object>
Group object - please use Get-SqlMonitorGroup or related methods to find the group.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-WindowsUserName
<String>
The username to connect to the Windows host. If not supplied, using Base Monitor service account.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-WindowsPassword
<String>
The password to connect to the Windows host. If not supplied, using Base Monitor service account.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-SqlServerAuthenticationMode
<String>
"windows" or "sqlServer" or "inherit", the last option uses the credentials supplied for Windows username/password or Base Monitor Service credentials.
Aliases | None |
Required? | false |
Position? | named |
Default Value | Inherit |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-SqlServerUserName
<String>
SQL login username to connect to SQL Server instance with.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-SqlServerPassword
<String>
SQL login password to connect to SQL Server instance with.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-NetworkProtocol
<String>
SQL Network Protocol. Valid values are 'default', 'sharedMemory', 'namedPipes' and 'tcpip'.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-SqlServerPort
<Int32>
SQL Server default port number.
Aliases | None |
Required? | false |
Position? | named |
Default Value | 0 |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-PacketSize
<Int32>
Packet size.
Aliases | None |
Required? | false |
Position? | named |
Default Value | 0 |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-ConnectionTimeout
<Int32>
Connection time-out.
Aliases | None |
Required? | false |
Position? | named |
Default Value | 0 |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-ExecutionTimeout
<Int32>
Execution time-out.
Aliases | None |
Required? | false |
Position? | named |
Default Value | 0 |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-EncryptConnection
<Boolean>
Encrypt connection.
Aliases | None |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-AutoDetectClusterName
<Boolean>
Auto detect cluster name.
Aliases | None |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-WmiType
<String>
WMI type. Value values are 'winrmhttps', 'winrmhttp' and 'dcom'.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-TrustServerCertificate
<Boolean>
Trust server certificate
Aliases | None |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-Type
<String>
"Cluster" or "AzureSqlServer" or "AzureManagedInstance" or "AmazonRdsSqlServer" or "SqlServerOnLinux"
Aliases | None |
Required? | false |
Position? | named |
Default Value | Cluster |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-Alias
<String>
Alias to set for the monitored object on creation. Only available for the AzureManagedInstance, AmazonRdsSqlServer and SqlServerOnLinux types.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
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.
-
None.
You cannot pipe input to this cmdlet.
Examples
-------------------------- EXAMPLE 1 --------------------------
Add-SqlMonitorMonitoredObject -MonitoredObject "localhost" -BaseMonitor $BaseMonitor
-------------------------- EXAMPLE 2 --------------------------
Add-SqlMonitorMonitoredObject -MonitoredObject "localhost" -BaseMonitor $BaseMonitor -Type "SqlServerOnLinux" -SshUserName "ssh_user" -SshPassword "ssh_pass" -SqlServerUserName "sa" -SqlServerPassword "sql_pass"