September 20, 2010 at 8:10 am
Hello everyone
The script that I am using is:
DECLARE @AuditLevel int
EXEC master..xp_regread
@rootkey='HKEY_LOCAL_MACHINE',
@key='SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\',
@value_name='AuditLevel',
@value=@AuditLevel OUTPUT
select @AuditLevel
There is no error messages reported by SQL Server, simply a "NULL" value is returned.
And I have verified on the target server, the value of the registry key of "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\AuditLevel" indeed exists and is 2.
I've used ths same script agains a number of other sql 2005 servers and most of them report correctly the audit level. The server I mentioned aboved is one of the few that reports "NULL" back.
Did I miss something here or doesn't xp_regread have enough privilege to read the value? BTW, I am using sysadmin role to run the above script and i am a local admin on the server too.
Thanks in advance!
Bazinga!
September 20, 2010 at 8:26 am
Check if the account running the sql server service has enough rights to look at the registery value.
September 20, 2010 at 9:18 am
Oliiii (9/20/2010)
Check if the account running the sql server service has enough rights to look at the registery value.
Hello Oliiii
The service account for this sql server instance is "local system account" which I think has sufficient read privilege on the registry.
Bazinga!
September 20, 2010 at 10:20 am
All the same it is a good idea to verify that the account has rights.
Look at the permissions set for the AuditLevel value in the registry and verify that there are no denies and that SYSTEM actually has read or better access granted to it.
I can replicate this behavior on a test box by removing SYSTEM from that value.
Sincerely,
Dan B
September 20, 2010 at 10:23 am
Oh yeah, have to add... "Please be careful modifying permissions in the registry." etc., etc... 🙂
September 21, 2010 at 1:22 am
skrilla99 (9/20/2010)
All the same it is a good idea to verify that the account has rights.Look at the permissions set for the AuditLevel value in the registry and verify that there are no denies and that SYSTEM actually has read or better access granted to it.
I can replicate this behavior on a test box by removing SYSTEM from that value.
Sincerely,
Dan B
Hallo skrilla99
Grateful to your post, but I don't quite follow the 'permission' on a registry value. Where can I get the settings for 'read' or 'modfiy' permissions on a registry then?
Sorry if I asked a very stupid question.
Thanks again!
Bazinga!
September 22, 2010 at 3:11 am
Right-click the key you're interested in and select Permissions. However, the SYSTEM account really ought to have permissions on everything in the registry--I'd be surprised if there was any part that didn't!
September 22, 2010 at 8:15 am
Paul,
I agree with everything you wrote except for the surprise. I have run into this too many times, mostly on workstations, where either users or some software has been "proactive" at securing the registry. 😉
sqlapprentice - Please, please be careful if you are not used to working in the registry. If you have a test box or some old machine you don't care about you would be well served by learning on that one first. Alternatively, if you have some Windows admins at your company this would be the time to get them involved.
Sincerely,
Dan B
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply