SQL Server – Upgrade Advisor – v2012 – Error – “Attempt to perform an unauthorized operation”

Background

Tried running “Upgrade Advisor” against a SQL Server instance, but getting the error pasted below:

Attempted to perform unauthorized operation ( mscorlib )

Configuration

Btw, the SQL Server instance is running within the Data Center of one of our ISPs.  And, so we are likely experiencing network issues.

 

Steps to reproduce

Let us take a few steps back and see what occurred prior to getting the error message.

SQL Server Components

On the SQL Server Components window, we enter the Server name.

Please be sure to enter the actual MS Windows Host name or the Cluster name.  Create DNS entries or local host names if need be.

Once you have entered the Server name, please click the Next button.

SQLServerComponents-Full

 

Connection Parameters

Parameters

  1. Instance name: MSSQLServer

ConnectionParameters

 

 

 

Error Message

If Domain Trust Relationship Not in place

Image

ConnectionParameters-NotTrusted

Textual

Unable to connect to server. Reason: Login failed for user ''. The user is not associated with a trusted SQL Server connection.

SQL Server Parameters

Choose the Databases to analyze…

SQLServerParameters

Confirm Upgrade Advisor Settings

ConfirmUpgradeAdvisorSettings_v2

Ugrade Advisor Progress

Here is the error message we get …

UpgradeAdvisorProgress

Error Message

Please click the “Attempted to perf “… message

Error Message Box

Here is a more in-depth look at our error message.

AttemptToPerformAnUnauthorizedOperation-Msgbox

Error Message Details

Image

AttemptToPerformAnUnauthorizedOperation-AdvancedInformation

Textual


===================================

Attempted to perform an unauthorized operation. (mscorlib)

------------------------------
Program Location:

   at Microsoft.Win32.RegistryKey.Win32ErrorStatic(Int32 errorCode, String str)
   at Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(RegistryHive hKey, String machineName, RegistryView view)
   at Microsoft.SqlServer.UpgradeAdvisor.SqlDetection.GetClusterInfo()
   at Microsoft.SqlServer.UpgradeAdvisor.SqlDetection.GetSqlInstances()
   at Microsoft.SqlServer.UpgradeAdvisor.SqlDetection.EngineExists()
   at Microsoft.SqlServer.UpgradeAdvisor.AnalyzerEngine.GetAnalyzer(AnalyzerType analyzerType)
   at Microsoft.SqlServer.UpgradeAdvisor.AnalyzerEngine.RunAnalyzer(AnalyzerType analyzerType, String& reportFile)


Diagnostic

SysInternals

Process Monitor

Tried to use SysInternal’s Process Monitor, but did not find what I was looking for.

Network Capture

As I said, I knew we likely have a Network Issue, and so a logical next step is so see if capturing network traffic will yield anything.

 

netsh

We are using MS Windows 7 and as such network capturing is built-in.

Initiate Trace

Code

Here is a code that will let us tack network traffic between us and our DB Server.

Please change the IP Address and possibly the base capture folder.

 

@ECHO OFF 
REM http://snipplr.com/view/21573/print-datetime-in-dos-batch-file/ 

set _LOGFILE_DATE=%DATE:~10,4%_%DATE:~4,2%_%DATE:~7,2% 
set _LOGFILE_TIME=%TIME:~0,2%_%TIME:~3,2%_%TIME:~6,2% 
set _LOGFILE=log-%_LOGFILE_DATE%-%_LOGFILE_TIME% 
set _fileExt=etl 
set _currentFolder=%cd% 
set _logFolder=%_currentFolder%\log 
set _logFileFull="%_logFolder%\%_LOGFILE%.%_fileExt%" 

if not exist %_logFolder% ( 
    mkdir %_logFolder% ) 

set "IPAddress=107.10.1.12" 

netsh trace start capture=yes Ethernet.Type=IPv4 IPV4.Address=%IPAddress% tracefile=%_logFileFull% 

 

 

Output

Image

NetworkTraceCapture - 20160430 - 1040AM

 

Reproduce Error

Reproduce the error a couple of times to ensure that Network Traffic is captured.

Stop Trace

Code


netsh trace stop

 

Output

NetworkTraceCaptureStopped - 20160430 - 1048AM

 

Microsoft Message Analyzer

Now that we have captured the Network Trace events.  We installed Microsoft Message Analyzer.

Filter

Upon loading our captured file, we filtered out SQL Server specific traffic


tcp.port != 1433

 

Output

LogonFailure=NTLM v1-cropped

Explanation

  1. Module :- SMB2
  2. Status :- STATUS_LOGON_FAILURE

Now, we know that SMB traffic (port 445) is fluid and we simply have authentication failure, let us deal with that.

 

Remediation

Run as

Initiate Command Session / as remote user

Syntax


runas /netonly /user:[remote-account] cmd

Sample


runas /netonly /user:ISP\daniel cmd

Enter your remote password

Use Initiated Command Session

Syntax


cd /D "D:\Program Files (x86)\Microsoft SQL Server Upgrade Advisor\110"

UpgradeAdvisorWizardCmd.exe

 

Summary

Thankfully, our network firewall rules are already fluid.  And, our registry access violation was simply because our corporate user did not have access.

Once we initiated a runas session and entered our ISP user credentials, we are good.

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s