I find the SMO function for getting default directories very nice:
http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.server.backupdirectory.aspx
...but I cannot get it to work on a particular server. I get:
(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.'
at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
...
Does someone know the minimal permissions for this function (and how to check this in advance?)
Cheers Dirkster