Notifications

182 views

Troubleshooting the credential issue while discovering MSSQL Database

Issue


When attempting to discover an MSSQL server, the MSSQL Probe will fail with Error: Authentication failure with the local MID server service credential.
 
In this scenario, you can run the following PowerShell script from the MID Server to verify the credentials.
 
If the credentials are successful, it should list the databases available on the SQL server.

Solution


 
 
script start ###### 
[reflection.assembly]::LoadWithPartialName('Microsoft.SqlServer.Smo');[reflection.assembly]::LoadWithPartialName('Microsoft.SqlServer.SqlWmiManagement'); 
 
#Please change password below with password for "<username@domain.com>" 
$password = "" 
 
$dbinstance = "\," 
$server = New-Object Microsoft.SqlServer.Management.Smo.Server($dbinstance) 
$server.ConnectionContext.LoginSecure = $true 
$server.ConnectionContext.ConnectAsUser = $true 
$server.ConnectionContext.ConnectAsUsername = "<username@domain.com>" 
$server.ConnectionContext.ConnectAsUserPassword = $password 
$server.Databases | select name 
script End ###### 

Article Information

Last Updated:2018-02-16 11:51:27
Published:2018-02-16