Acquire SQL Service Account
Reference: Jason Yousef Blog
1: DECLARE @SrvAccount varchar(100)
2: set @SrvAccount =''
3:
4: EXECUTE master.dbo.xp_instance_regread
5: N'HKEY_LOCAL_MACHINE',
6: N'SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT',
7: N'ObjectName',
8: @SrvAccount OUTPUT,
9: N'no_output'
10:
11: SELECT
12: @@SERVERNAME as [MachineName]
13: , @SrvAccount as SQLAgent_ServiceAccount
Comments
Post a Comment