SQL Server service account information can be fetched from registry or from sys.dm_server_services for versions starting from SQL Server 2008 R2 SP1 and above. This blog provides script to find SQL Server service account.

Execute below query to get the service account of current SQL Server installation from the registry.

The output from above query is shown below.

1_script to find sql server service account

Another way is to query sys.dm_server_services view. This gives the details for all installed SQL Server instances. It is available from SQL Server 2008 R2 SP1.

2_script to find sql server service account

Regards

Ahmad Osama

Like us on FaceBook Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook