I can't use the "ManagementScope" to connect the SQL Server 2019

0

My code:

var nameSpace = string.Format(@"\\{0}\root\Microsoft\SqlServer", machineName);
var scope = new ManagementScope(nameSpace, null);

scope.Connect();

I get this error:

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Do you know why?

sql-server-2019
asked on Stack Overflow Dec 17, 2018 by Jeffrey • edited Dec 17, 2018 by marc_s

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0