“Test-SPContentDatabase : The server instance of the database could not be found.”
This error shows up, even when the database is reachable. I’ve tried everything from DNS aliases to direct ip connections, but the error didn’t go away. So I was playing with the Get-SPContentDatabase cmdlet and turned out I managed to trigger something that made the Test-SPContentDatabase work.
Get-SPContentDatabase -ConnectAsUnattachedDatabase -DatabaseServer SERVER\SQL1 -DatabaseName DBNAME
This will trigger a compatibility range mismatch error, but nevermind that.
Now, however, the Test-SPContentDatabase cmdlet runs without problems!
Test-SPContentDatabase -name DBNAME -WebApplication http://sharepoint -ServerInstance SERVER\SQL1