Database Management
The supplied target is invalid for the instance you are trying to add in SQL Sentry
The current error message in the PowerShell module may not be very helpful when a user who is not part of the Local Admin Group tries to add an SSAS instance to SQL Sentry. This article provides steps to workaround this PowerShell module limitation.
First published date
Last published date
Overview
When a user attempts to add an SSAS target to SQL Sentry using the PowerShell module without being in the Local Admin Group, they encounter the following error:Register-Connection : The supplied target is invalid for the instance you are trying to add.
Product section
Cause
-
The user account running the PowerShell command is not a member of the Local Admin Group on the SSAS server, which is required for SSAS access through SQL Sentry.
-
Alternatively, the error can occur if there is a mismatch between the target type and the instance type (e.g., trying to add a Windows target to a SQL Server instance)
Resolution
-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.
Step 1: Register Nodes (Without SSAS)
Use the following PowerShell script to register the Windows nodes. Note that this step will not add the SSAS instance due to the current permission limitations. These steps assume that the following path will contain a text file with multiple Windows node details "C:\Path\To\servers.txt".
Be sure to:
Replace
<SQLSentryServerHost>with your actual server name.Update the path to the correct server list text file.
# Load the SQL Sentry PowerShell module
Import-Module 'C:\ProgramData\SentryOne\monitoringservice\bin\Intercerve.SQLSentry.Powershell.psd1'
# Connect to SQL Sentry
Connect-SQLSentry -ServerName <SQLSentryServerHost> -DatabaseName SQLSentry
# Read servers from text file and loop through each
$servers = Get-Content -Path "C:\Path\To\servers.txt"
foreach ($TargetServer in $servers)
{
Write-Host "Registering: $TargetServer"
Register-Computer -ComputerType Windows -Name $TargetServer -AccessLevel Full
}
Step 2: Add SSAS Instances via UI
Once the nodes are registered:
-
Open the SQL Sentry UI.
-
Manually add the SSAS instances to the registered nodes.
-
Important: This will only work if the client user running the UI is a System Administrator on the SSAS servers.
If the user is not a System Administrator on the SSAS instance, you may encounter the following error:
"Object reference not set to an instance of an object"