Tried running “Upgrade Advisor” against a SQL Server instance, but getting the error pasted below:
“Attempted to perform unauthorized operation ( mscorlib )“
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.
- Instance name: MSSQLServer
If Domain Trust Relationship Not in place
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…
Confirm Upgrade Advisor Settings
Ugrade Advisor Progress
Here is the error message we get …
Please click the “Attempted to perf “… message
Error Message Box
Here is a more in-depth look at our error message.
Error Message Details
=================================== 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)
Tried to use SysInternal’s Process Monitor, but did not find what I was looking for.
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.
We are using MS Windows 7 and as such network capturing is built-in.
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=220.127.116.11" netsh trace start capture=yes Ethernet.Type=IPv4 IPV4.Address=%IPAddress% tracefile=%_logFileFull%
Reproduce the error a couple of times to ensure that Network Traffic is captured.
netsh trace stop
Microsoft Message Analyzer
Now that we have captured the Network Trace events. We installed Microsoft Message Analyzer.
Upon loading our captured file, we filtered out SQL Server specific traffic
tcp.port != 1433
- Module :- SMB2
- 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.
Initiate Command Session / as remote user
runas /netonly /user:[remote-account] cmd
runas /netonly /user:ISP\daniel cmd
Enter your remote password
Use Initiated Command Session
cd /D "D:\Program Files (x86)\Microsoft SQL Server Upgrade Advisor\110" UpgradeAdvisorWizardCmd.exe
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.