You can determine the SQL Server Agent service account from three places that agree in a healthy installation: SQL Server Configuration Manager (the service’s “Log On As” identity), the Windows Services console (the same logon identity from the operating system’s point of view), and, inside SQL Server, the sys.dm_server_services dynamic management view or the xp_slave_* extended stored procedures. The reliable condition is that you need enough permission to see the account: local administrator on the host for the Windows tools, and membership in sysadmin or at least VIEW SERVER STATE on the instance for the T-SQL routes. A common trap is confusing the account that runs the Agent with the account the Agent uses when it connects to the instance, or with the SQL Server Database Engine’s own service account, which is a different service entirely.

That distinction matters more than it sounds. SQL Server Agent is a separate Windows service named SQLSERVERAGENT (for a default instance) or SQLAgent$InstanceName (for a named instance). When you go looking for “the service account,” you might actually be chasing one of four things: the Windows identity the service runs under, the SQL login the Agent impersonates for job steps, a proxy credential used by specific subsystems like PowerShell or SSIS, or the Database Engine account that people sometimes call “the SQL account.” This article walks through how to find each one, in the order that gets you a trustworthy answer fastest, with a check at each stage and the specific signs that you’ve hit a wall.

Start With The Instance Type Because Named Instances Change Every Command

Before you run anything, confirm what you’re looking at, because the service name, registry path, and even some DMV column values change with the instance. Open a command prompt on the server and run sc query type= service state= all | findstr /I "SQLSERVERAGENT SQLAgent". On a default instance you’ll see SQLSERVERAGENT; on a named instance you’ll see SQLAgent$YourInstanceName. If you run a multi-instance host, this single command tells you which Agent services exist so you don’t query the wrong one.

You can also chain the discovery to the query in one step using SQL Server’s own configuration:

InstanceName returns NULL for a default instance, a name for a named one, and you should note whether the instance is clustered, because in a failover cluster the Agent service is a clustered resource and moving it between nodes can change which node hosts the running service. The success check here is simple: the service name you found with sc query must match the instance you’re about to query. If it doesn’t, you’re on a box with multiple instances and you need to pick the right SQLAgent$... service before proceeding.

Read The Account From SQL Server Configuration Manager

Configuration Manager is the most direct tool because it was built to show exactly this. Open it from the Start menu (it lives under SQL Server’s Configuration Tools folder for your installed version, and it’s also reachable as SQLServerManager.msc). In the left pane, click SQL Server Services. The right pane lists every SQL Server–related service with a Log On As column. Find the row whose Service name is SQLSERVERAGENT or SQLAgent$YourInstance, and read the Log On As value.

You’ll see one of three forms. A built-in virtual account looks like NT Service\SQLSERVERAGENT or NT Service\SQLAgent$YourInstance—this is the default for newer installations and it’s a per-service identity Windows generates automatically. A built-in system account looks like LocalSystem, NetworkService, or LocalService. A domain or local user account looks like DOMAIN\svc_sqlagent or MACHINE\svc_sqlagent.

The success check is that the Service name and the instance you identified earlier agree. A failure here is usually one of two things: the services list is empty or grayed out (you’re not a local administrator, or the WMI provider is unhappy—try running Configuration Manager as administrator), or you see the service but the Log On As column is blank (rare, and usually a WMI/provider glitch; fall back to the Services console). If you’re remote and Configuration Manager can’t reach the server, don’t fight it—use the next method, which works over a remote desktop session or with sc.

Confirm The Same Identity From The Windows Services Console

The Services console (run services.msc, or open Services from Computer Management) shows the same logon identity, and it’s the authoritative source for what Windows will actually start the service as. Sort by name, find SQL Server Agent (INSTANCE) or SQL Server Agent, double-click it, and look at the Log On tab. The This account radio button with a name in the field means a specific user; the Local System account radio button means the built-in system account.

Two details reward attention here. First, the Log On tab is also where the password for a specific account is stored, and if someone changed the password in Active Directory without updating it here, the service will fail to start with error 1069 (“The service did not start due to a logon failure”). That failure is itself a diagnostic: it tells you the configured account is a specific user and the credentials are stale, which is exactly the situation where people go hunting for “the service account” in a panic. Second, the Services console can be reached from a remote machine via sc \SERVERNAME qc SQLSERVERAGENT to print the service’s configuration, including SERVICE_START_NAME, without opening a GUI. That command is a clean way to check from a jump box:

Look for the SERVICE_START_NAME line. It returns the account in DOMAIN\user or NT AUTHORITY... form. If you get “Access is denied,” you lack the remote service query right—another permission wall, not a missing account.

Query The Instance Itself With sys.dm_server_services

Once you can connect to the instance, T-SQL gives you a version-independent answer. The dynamic management view sys.dm_server_services returns one row per SQL Server–related service, including service_account, and it works from SQL Server 2008 R2 onward (the view exists in 2008 R2; on SQL Server 2008 and earlier you’d rely on the registry or xp_slave_* procedures). The query:

servicename will read SQL Server Agent (INSTANCE) or SQL Server Agent, and service_account gives you the account string. The permission requirement is VIEW SERVER STATE on the instance (sysadmin includes it). If you get an empty result set rather than an error, you may be on an edition or version where the view behaves differently, or you connected to a different instance than you think—re-check @@SERVERNAME and SERVERPROPERTY('InstanceName') in the same session.

A subtlety: sys.dm_server_services reports the account the service is configured to run as, which is normally the same as what Windows reports. On a clustered instance, the value can reflect the resource’s configured identity, and during a failover there can be a brief window where the reported account and the running process disagree. Treat a mismatch as “check again after the cluster settles,” not as a permanent finding.

Use The xp_slave_* Procedures When The DMV Is Unavailable

On older builds, or when you want a second source that doesn’t depend on the DMV’s permissions, SQL Server exposes undocumented-but-stable extended stored procedures that read the service registry keys directly. The two you care about are xp_slave_netname and xp_slave_account. Run them in a query window:

xp_slave_account returns the account the service is configured with, in the same string form you’d see in Configuration Manager. Because these procedures are undocumented, treat them as a cross-check rather than your primary method, and don’t build automation on them without a fallback. The permission profile is similar—sysadmin or equivalent—so they don’t get you past the permission wall; they just give you a second reading once you’re through it.

The Registry And WMI Routes For Scripted Or Remote Checks

For inventory scripts across many servers, the registry is the most scriptable source because it doesn’t require a SQL connection at all. The service’s configuration lives under:

and for a named instance:

The value you want is ObjectName under that key. It holds the account string exactly as the service control manager stores it. You can read it with reg query:

or with PowerShell:

The registry route works remotely with the right permissions and doesn’t need the SQL instance to be up, which makes it the best choice when the Agent service is stopped and you’re diagnosing why. The same caveat applies: ObjectName is the configured identity, and if the password stored alongside it is stale you’ll still get the account name but the service won’t start.

WMI offers a parallel route. The Win32_Service class exposes StartName for the service:

StartName returns the account in DOMAIN\user form or a well-known name for built-in accounts. This is the friendliest option for a remote PowerShell session and it matches what the Services console shows.

Don’t Confuse The Agent’s Service Account With Its SQL Login Or Proxies

This is where most “I found the account, but jobs still fail” investigations go wrong. The Windows account the Agent service runs under is not necessarily the login the Agent uses when it connects to the instance to run T-SQL job steps. The Agent connects using a SQL Server login, and the mapping between the Windows service account and a SQL login is what matters for job execution. You can see the Agent’s connection identity indirectly through job history and msdb, but the cleaner check is to look at what login owns the Agent’s subsystem steps. For T-SQL job steps, the step runs as the job owner by default, or as a specified user; for operating-system steps (CmdExec), PowerShell, and SSIS, the step runs under a proxy whose credential is a SQL Server credential mapped to a Windows account.

To see proxies and their credentials:

credential_identity gives you the Windows account behind each proxy, which is frequently a different account from the Agent service account—often deliberately, because you want least privilege per subsystem. When someone asks “what account does SQL Server Agent use,” clarify which of these they mean before you answer, or you’ll hand them the wrong string.

The same caution applies to the Database Engine’s service account (SQLSERVER / MSSQL$Instance), which is a separate service and often a different account. If a job step needs to reach a file share, the identity that matters is the proxy or the Agent service account, not the engine’s account, and mixing them up produces permission errors that look mysterious.

What The Account Actually Tells You And Where To Stop

The account string is the start of a permissions conversation, not the end. Once you know it, the practical questions are: does this account have a SQL login with the rights the jobs need, does it have the Windows rights to read the directories and shares that CmdExec and PowerShell steps touch, and is it a domain account when the jobs cross machine boundaries? A built-in virtual account like NT Service\SQLSERVERAGENT works locally but has no network identity on other machines, so cross-server jobs will fail unless you use a domain account or a proxy. A LocalSystem account is powerful locally and presents the machine account to the network, which is sometimes acceptable and sometimes a security finding. A domain service account is the usual choice for production when jobs go off-box.

Stop and involve a professional when the next step would be changing the service account or resetting its password on a production instance. Those changes require coordinating the SQL login, the service restart, any proxies and credentials that reference the old account, and—in a cluster—the clustered resource’s identity. Getting that wrong takes the Agent offline and can break scheduled maintenance with no obvious cause. Also stop if you find the account is a personal user account or a domain admin; that’s a configuration that needs a planned migration, not an ad hoc edit.

A quick sanity check that ties the whole picture together: confirm the service account from Configuration Manager, confirm the same string from sys.dm_server_services, and confirm the proxies separately. If those three agree with what you expected, you have the answer. If the service account and the DMV disagree, you’re likely looking at a stale cached value or the wrong instance—reconnect and re-query before you conclude anything.

For a one-line answer you can paste into a ticket: run SELECT servicename, service_account FROM sys.dm_server_services WHERE servicename LIKE 'SQL Server Agent%'; as a sysadmin, and cross-check the Log On As column in Configuration Manager. Everything else in this article is there for the cases where that clean path is blocked by permissions, stopped services, or the confusion between the service account, the Agent’s SQL login, and per-subsystem proxies.