This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing a script for finding the Service Account Name which used by the SQL Server Windows services like SQL Agent.
Using xp_instance_regread, you can find this information.
Please check the below script:
1 2 3 4 5 6 7 8 |
DECLARE @ServiceAccountName varchar(50) EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE' ,N'SYSTEM\CurrentControlSet\Services\MSSQLSERVER' ,N'ObjectName' ,@ServiceAccountName OUTPUT SELECT @ServiceAccountName AS ServiceAccountName |
Result:
1 2 3 |
ServiceAccountName ------------------------ NT Service\MSSQLSERVER |