API Reference
Command
Test-ADXSqlServer
Tests SQL Server monitoring connectivity, services, backups, CHECKDB, SQL Agent, and optional availability group telemetry.
Examples
Example 1: Check a SQL Server target using the current Windows identity
Test-ADXSqlServer -Target 'sql01.contoso.com,1433' -TrustServerCertificate -IncludeChildResults
Example 2: Check SQL Server with SQL login credentials from a secret reference
Test-ADXSqlServer -Target 'sql01.contoso.com\APP' -AuthenticationMode SqlLogin -Username 'monitor' -PasswordSecret 'env:SQL_MONITOR_PASSWORD'
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Test-ADXSqlServer [-Target <string[]>] [-AgentJobIssueHandling <Ignore|Degraded|Down>] [-AuthenticationMode <ServiceAccount|SqlLogin|WindowsCredential>] [-AvailabilityGroupIssueHandling <Ignore|Degraded|Down>] [-BackupIssueHandling <Ignore|Degraded|Down>] [-CheckDbIssueHandling <Ignore|Degraded|Down>] [-CollectorIssueHandling <Ignore|Degraded|Down>] [-Database <string>] [-DatabaseStateIssueHandling <Ignore|Degraded|Down>] [-DiscoverFromActiveDirectory] [-DiscoveryBindIdentity <string>] [-DiscoveryBindSecret <string>] [-DomainController <string>] [-DomainName <string>] [-ExcludeDomain <string[]>] [-ForestName <string>] [-IncludeAvailabilityGroups] [-IncludeChildResults] [-IncludeDisabledAgentJobs] [-IncludeDomain <string[]>] [-IncludeSystemDatabases] [-IncludeTrusts] [-IncludeWaitStatistics] [-MaxCheckDbAgeDays <int>] [-MaxConcurrency <int>] [-MaxDiscoveredInstances <int>] [-MaxFullBackupAgeHours <int>] [-MaxLogBackupAgeMinutes <int>] [-Name <string>] [-PasswordSecret <string>] [-Port <int>] [-SearchBaseDn <string>] [-ServiceIssueHandling <Ignore|Degraded|Down>] [-SkipAgentJobs] [-SkipBrowserService] [-SkipServices] [-SkipSqlBrowserPortResolution] [-SkipTcpPortCheck] [-SqlBrowserTimeoutSeconds <int>] [-TimeoutSeconds <int>] [-TrustServerCertificate] [-Username <string>] [-WindowsCredentialPasswordSecret <string>] [-WindowsCredentialUsername <string>] [<CommonParameters>]#Parameters
- Target string[]
- Explicit SQL Server targets such as sql01, sql01\instance, or sql01,1433.
- AgentJobIssueHandling SqlServerIssueHandling
- Controls how SQL Agent job findings affect status. Possible values: Ignore, Degraded, Down
- Possible values:
Ignore,Degraded,Down - AuthenticationMode SqlServerProbeAuthenticationMode
- Authentication mode for SQL monitoring. Possible values: ServiceAccount, SqlLogin, WindowsCredential
- Possible values:
ServiceAccount,SqlLogin,WindowsCredential - AvailabilityGroupIssueHandling SqlServerIssueHandling
- Controls how Availability Group findings affect status. Possible values: Ignore, Degraded, Down
- Possible values:
Ignore,Degraded,Down - BackupIssueHandling SqlServerIssueHandling
- Controls how missing or stale backup findings affect status. Possible values: Ignore, Degraded, Down
- Possible values:
Ignore,Degraded,Down - CheckDbIssueHandling SqlServerIssueHandling
- Controls how stale or unknown CHECKDB findings affect status. Possible values: Ignore, Degraded, Down
- Possible values:
Ignore,Degraded,Down - CollectorIssueHandling SqlServerIssueHandling
- Controls how collector warnings affect status. Possible values: Ignore, Degraded, Down
- Possible values:
Ignore,Degraded,Down - Database string
- Database used for connection-level checks.
- DatabaseStateIssueHandling SqlServerIssueHandling
- Controls how database state findings affect status. Possible values: Ignore, Degraded, Down
- Possible values:
Ignore,Degraded,Down - DiscoverFromActiveDirectory SwitchParameter
- Discovers SQL Server instances from Active Directory MSSQLSvc SPNs.
- DiscoveryBindIdentity string
- Optional LDAP bind identity used for SQL SPN discovery.
- DiscoveryBindSecret string
- Optional LDAP bind secret reference used for SQL SPN discovery.
- DomainController string
- Optional domain controller used for SQL SPN discovery.
- DomainName string
- Optional domain name used for SQL SPN discovery.
- ExcludeDomain string[]
- Exclude these domains during SQL SPN discovery.
- ForestName string
- Optional forest name used for SQL SPN discovery.
- IncludeAvailabilityGroups SwitchParameter
- Includes Availability Group replica and database synchronization health.
- IncludeChildResults SwitchParameter
- Writes child SQL diagnostic results from the aggregate result.
- IncludeDisabledAgentJobs SwitchParameter
- Includes disabled SQL Agent jobs.
- IncludeDomain string[]
- Include only these domains during SQL SPN discovery.
- IncludeSystemDatabases SwitchParameter
- Includes system databases in database, backup, and CHECKDB checks.
- IncludeTrusts SwitchParameter
- Includes trusted domains during SQL SPN discovery.
- IncludeWaitStatistics SwitchParameter
- Includes wait statistics as diagnostic child results.
- MaxCheckDbAgeDays int
- Maximum accepted age for last known good CHECKDB in days.
- MaxConcurrency int
- Maximum concurrent SQL target checks.
- MaxDiscoveredInstances int
- Maximum SQL Server instances discovered from Active Directory.
- MaxFullBackupAgeHours int
- Maximum accepted age for full backups in hours.
- MaxLogBackupAgeMinutes int
- Maximum accepted age for log backups in minutes.
- Name string
- Probe name written to the result object.
- PasswordSecret string
- SQL login secret reference when using SQL Server authentication.
- Port int
- TCP port used for explicit targets without a port.
- SearchBaseDn string
- Optional search base distinguished name for SQL SPN discovery.
- ServiceIssueHandling SqlServerIssueHandling
- Controls how SQL Server service findings affect status. Possible values: Ignore, Degraded, Down
- Possible values:
Ignore,Degraded,Down - SkipAgentJobs SwitchParameter
- Skips SQL Agent job health collection.
- SkipBrowserService SwitchParameter
- Skips SQL Browser service health when service checks are enabled.
- SkipServices SwitchParameter
- Skips Windows service checks.
- SkipSqlBrowserPortResolution SwitchParameter
- Skips SQL Browser named-instance port resolution.
- SkipTcpPortCheck SwitchParameter
- Skips the TCP port preflight check.
- SqlBrowserTimeoutSeconds int
- SQL Browser UDP resolution timeout in seconds.
- TimeoutSeconds int
- Overall per-target timeout in seconds.
- TrustServerCertificate SwitchParameter
- Trusts the SQL Server certificate while keeping SQL encryption enabled.
- Username string
- SQL login name when using SQL Server authentication.
- WindowsCredentialPasswordSecret string
- Windows credential secret reference used with AuthenticationMode WindowsCredential.
- WindowsCredentialUsername string
- Windows identity used with AuthenticationMode WindowsCredential.
Outputs
ADPlayground.Monitoring.Probes.ProbeResult