who can explain why when i use this code:
ServerConnection conn = ServerConnection(serverName);
var server = new Server(conn);
string testInstance = server.NetName
next exception is thrown:
"Caught exception in SQL Product Configuration wizard. Exception: Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: xp_regread()
returned error 5, 'Access is denied.'
xp_regread() returned error 5, 'Access is denied.'
xp_regread() returned error 5, 'Access is denied.'"
user can connect using SQL management studio.
It will only work if i give user "SysAdmin" permission. Obviously it is too high of a permission to read server and db properties
Any help is much appreciated,
View Complete Post