I had recently a weired requirement to get the SQL server AGENT Account from multiple servers, so I'm sharing how to get it through T-SQL
SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT
DECLARE @SrvAccount varchar(100)And the location the registry would be at ...
set @SrvAccount =''
EXECUTE master.dbo.xp_instance_regread
N'HKEY_LOCAL_MACHINE',
N'SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT',
N'ObjectName',
@SrvAccount OUTPUT,
N'no_output'
SELECT @SrvAccount as SQLAgent_ServiceAccount
SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT
No comments:
Post a Comment