Ad Code

How to Check Service Account Name for SQL Server and SQL Server Agent

How to Check Service Account Name for SQL Server and SQL Server Agent

There are few methods to find service account name in SQL Server Management Studio (SSMS).

Method 1 – Using T-SQL

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

Results



 

In new versions of SQL Server, there is a catalog view – dm_server_services which can be used to get same details.

Use below scripts to find service account name of SQL Server

SELECT servicename, service_account

FROM sys.dm_server_services

 GO

 

Method -2

Start > Run > Services.msc




Method 3 – SQL Server Configuration Manager

We can open SQL Server Configuration Manager for respective version. Once opened, click on “SQL Server Services” and then look for “Log On As” column to get service account.







Post a Comment

0 Comments

Close Menu