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?
User contributions licensed under CC BY-SA 3.0