{"id":1868,"date":"2014-01-23T11:00:08","date_gmt":"2014-01-23T16:00:08","guid":{"rendered":"http:\/\/sqlity.net\/en\/?p=1868"},"modified":"2015-10-26T17:58:21","modified_gmt":"2015-10-26T21:58:21","slug":"identify-sql-server-service-account-in-t-sql","status":"publish","type":"post","link":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/","title":{"rendered":"How to identify the SQL Server Service Account in T-SQL"},"content":{"rendered":"<div>\n<h3>Introduction<\/h3>\n<p>\nEvery once in a while you need to know the service account that is executing SQL Server, for example to grant SQL Server access to a new windows resource. When you are remoted to the machine running the instance in question already, you can just start the SQL Server Configuration Manager to find out. But sometimes it would just be quicker to use T-SQL for this.\n<\/p>\n<h3>Identifying the SQL Server Service Account the Old (and Hard) Way<\/h3>\n<p>\nIn SQL Server 2005 and SQL Server 2008 there was no documented way. Some people used the undocumented <span class=\"tt\">xp_regread<\/span> to find that information in an undocumented place in the registry:\n<\/p>\n<div>\n[sql]\nDECLARE @sn NVARCHAR(128);<\/p>\n<p>EXEC master.dbo.xp_regread<br \/>\n    'HKEY_LOCAL_MACHINE',<br \/>\n    'SYSTEM\\CurrentControlSet\\services\\SQLSERVERAGENT',<br \/>\n    'ObjectName',<br \/>\n    @sn OUTPUT;<\/p>\n<p>SELECT @sn;<br \/>\n[\/sql]\n<\/p><\/div>\n<p>\nYou can find more details about that approach and its inherent dangers <a href=\"http:\/\/stackoverflow.com\/questions\/7324407\/get-service-account-details-of-the-sql-agent-service\" target=\"stackoverflow\">here on stackoverflow<\/a>. (That is where I found above query too.)\n<\/p>\n<p>\nThis seems to work, but using undocumented ways always runs the risk of suddenly breaking because of a change Microsoft decided to implement.\n<\/p>\n<h3>Identifying the SQL Server Service Account the New Way<\/h3>\n<p>\nSince SQL Server 2008R2 SP1 we have a documented way to get to this information: <span class=\"tt\">sys.dm_server_services<\/span>\n<\/p>\n<p>\n<span class=\"tt\">sys.dm_server_services<\/span> gives us information about the current state of the services related to SQL Server that are currently installed.<br \/>\nThe information includes the startup type, the startup time the path and file name of the executable and, you guessed it, the account that the service is running under.\n<\/p>\n<p><!--AD--><br \/>\n<script type='text\/javascript'>\twp_cta_load_variation( '2930', '' )<\/script><style type=\"text\/css\" id=\"wp_cta_css_custom_2930_0\" class=\"wp_cta_css_2930 \"> <\/style><script type=\"text\/javascript\">jQuery(document).ready(function($) {\r\n\t\t\t\t\t });<\/script><style type=\"text\/css\" id=\"wp_cta_css_custom_2930_1\" class=\"wp_cta_css_2930 \"> <\/style><script type=\"text\/javascript\">jQuery(document).ready(function($) {\r\n\t\t\t\t\t });<\/script><style type=\"text\/css\" id=\"wp_cta_css_custom_2930_2\" class=\"wp_cta_css_2930 \"> <\/style><script type=\"text\/javascript\">jQuery(document).ready(function($) {\r\n\t\t\t\t\t });<\/script><style type=\"text\/css\" id=\"wp_cta_css_custom_2930_3\" class=\"wp_cta_css_2930 \"> <\/style><script type=\"text\/javascript\">jQuery(document).ready(function($) {\r\n\t\t\t\t\t });<\/script><style type=\"text\/css\" id=\"wp_cta_css_custom_2930_4\" class=\"wp_cta_css_2930 \"> <\/style><script type=\"text\/javascript\">jQuery(document).ready(function($) {\r\n\t\t\t\t\t });<\/script><style type=\"text\/css\" id=\"wp_cta_css_custom_2930_5\" class=\"wp_cta_css_2930 \"> <\/style><script type=\"text\/javascript\">jQuery(document).ready(function($) {\r\n\t\t\t\t\t });<\/script><style type=\"text\/css\" id=\"wp_cta_css_custom_2930_6\" class=\"wp_cta_css_2930 \"> <\/style><script type=\"text\/javascript\">jQuery(document).ready(function($) {\r\n\t\t\t\t\t });<\/script><div id='wp_cta_2930_container' class='wp_cta_container cta_outer_container' style='margin-top:0px;margin-bottom:0px;position:relative;' ><div id='wp_cta_2930_variation_0' class='inbound-cta-container wp_cta_content wp_cta_variation wp_cta_2930_variation_0' style='display:none; margin:auto; width: px; height: px;'  data-variation='0' data-cta-id='2930'><div class=\"blank-cta-template\">&#13;\n\t<a href=\"https:\/\/sqlity.net\/inbound\/4v15bod6\" style=\"text-decoration: none;\" rel=\"nofollow\">&#13;\n<div style=\"margin:10px 0;padding:5px;border:1px solid #196db6; border-radius:5px;\">&#13;\n  <span style=\"float:left; margin-right: 10px\">&#13;\n<img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2907 alignleft\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/A-300x203.jpg\" alt=\"Ad_Campaign_Oct2015_A\" width=\"300\" height=\"203\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/A-300x203.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/A-150x102.jpg 150w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/A.jpg 450w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/img>&#13;\n  <\/span>&#13;\n  <span>&#13;\n  <p style=\"margin-top:10px;\">&#13;\n<code style=\"font-weight:bold;color:#006699\">Are you smarter than a script kiddie?<\/code><br><\/br><br><\/br>&#13;\nKids can download and run code to hack into your database. \u00a0<strong>Are you prepared to be hacked by a 5th grader?<\/strong> Watch this exclusive 15 minute video to learn the most critical elements of securing your SQL Server database.&#13;\n    <\/p>&#13;\n  <\/span>&#13;\n  <div style=\"clear:both\"><\/div>&#13;\n<\/div>&#13;\n<\/a>&#13;\n<\/div><\/div><div id='wp_cta_2930_variation_1' class='inbound-cta-container wp_cta_content wp_cta_variation wp_cta_2930_variation_1' style='display:none; margin:auto; width: px; height: px;'  data-variation='1' data-cta-id='2930'><div class=\"blank-cta-template\">&#13;\n\t<a href=\"https:\/\/sqlity.net\/inbound\/5owolbiu\" style=\"text-decoration: none;\" rel=\"nofollow\">&#13;\n<div style=\"margin:10px 0;padding:5px;border:1px solid #196db6; border-radius:5px;\">&#13;\n  <span style=\"float:left; margin-right: 10px\">&#13;\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/B-300x300.jpg\" alt=\"B\" width=\"300\" height=\"300\" class=\"size-medium wp-image-2922\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/B-300x300.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/B-150x150.jpg 150w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/B-50x50.jpg 50w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/B.jpg 450w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/img>&#13;\n  <\/span>&#13;\n  <span>&#13;\n  <p style=\"margin-top:10px;\">&#13;\n<code style=\"font-weight:bold;color:#006699\">Do you have any holes in your fortress?<\/code><br><\/br><br><\/br>&#13;\n Watch this exclusive 15 minute video to learn the most critical elements of securing your SQL Server database.&#13;\n    <\/p>&#13;\n  <\/span>&#13;\n  <div style=\"clear:both\"><\/div>&#13;\n<\/div>&#13;\n<\/a>&#13;\n<\/div><\/div><div id='wp_cta_2930_variation_2' class='inbound-cta-container wp_cta_content wp_cta_variation wp_cta_2930_variation_2' style='display:none; margin:auto; width: px; height: px;'  data-variation='2' data-cta-id='2930'><div class=\"blank-cta-template\">&#13;\n\t<a href=\"https:\/\/sqlity.net\/inbound\/39du2vilo1\" style=\"text-decoration: none;\" rel=\"nofollow\">&#13;\n<div style=\"margin:10px 0;padding:5px;border:1px solid #196db6; border-radius:5px;\">&#13;\n  <span style=\"float:left; margin-right: 10px\">&#13;\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/C-300x300.jpg\" alt=\"C\" width=\"300\" height=\"300\" class=\"size-medium wp-image-2923\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/C-300x300.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/C-150x150.jpg 150w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/C-50x50.jpg 50w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/C.jpg 450w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/img>&#13;\n  <\/span>&#13;\n  <span>&#13;\n  <p style=\"margin-top:10px;\">&#13;\n<code style=\"font-weight:bold;color:#006699\">Data thieves want to cash in on your customers' information.<\/code><br><\/br><br><\/br>&#13;\nThey'll steal it out of your database if you're not prepared. Watch this exclusive 15 minute video to learn the most critical elements of securing your SQL Server database.&#13;\n    <\/p>&#13;\n  <\/span>&#13;\n  <div style=\"clear:both\"><\/div>&#13;\n<\/div>&#13;\n<\/a>&#13;\n<\/div><\/div><div id='wp_cta_2930_variation_3' class='inbound-cta-container wp_cta_content wp_cta_variation wp_cta_2930_variation_3' style='display:none; margin:auto; width: px; height: px;'  data-variation='3' data-cta-id='2930'><div class=\"blank-cta-template\">&#13;\n\t<a href=\"https:\/\/sqlity.net\/inbound\/in210b9l6\" style=\"text-decoration: none;\" rel=\"nofollow\">&#13;\n<div style=\"margin:10px 0;padding:5px;border:1px solid #196db6; border-radius:5px;\">&#13;\n  <span style=\"float:left; margin-right: 10px\">&#13;\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/D-298x300.jpg\" alt=\"D\" width=\"298\" height=\"300\" class=\"size-medium wp-image-2924\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/D-298x300.jpg 298w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/D-150x150.jpg 150w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/D-50x50.jpg 50w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/D.jpg 447w\" sizes=\"auto, (max-width: 298px) 100vw, 298px\" \/><\/img>&#13;\n  <\/span>&#13;\n  <span>&#13;\n  <p style=\"margin-top:10px;\">&#13;\n<code style=\"font-weight:bold;color:#006699\">Hackers are coming!<\/code><br><\/br><br><\/br>&#13;\nIs your SQL Server ready? Watch this exclusive 15 minute video to learn the most critical elements of securing your SQL Server database.&#13;\n    <\/p>&#13;\n  <\/span>&#13;\n  <div style=\"clear:both\"><\/div>&#13;\n<\/div>&#13;\n<\/a>&#13;\n<\/div><\/div><div id='wp_cta_2930_variation_4' class='inbound-cta-container wp_cta_content wp_cta_variation wp_cta_2930_variation_4' style='display:none; margin:auto; width: px; height: px;'  data-variation='4' data-cta-id='2930'><div class=\"blank-cta-template\">&#13;\n\t<a href=\"https:\/\/sqlity.net\/inbound\/ibon63in\" style=\"text-decoration: none;\" rel=\"nofollow\">&#13;\n<div style=\"margin:10px 0;padding:5px;border:1px solid #196db6; border-radius:5px;\">&#13;\n  <span style=\"float:left; margin-right: 10px\">&#13;\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/E-300x251.jpg\" alt=\"E\" width=\"300\" height=\"251\" class=\"size-medium wp-image-2925\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/E-300x251.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/E-150x126.jpg 150w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/E.jpg 450w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/img>&#13;\n  <\/span>&#13;\n  <span>&#13;\n  <p style=\"margin-top:10px;\">&#13;\n<code style=\"font-weight:bold;color:#006699\">Is your data an easy target?<\/code><br><\/br><br><\/br>&#13;\nHackers look for the easiest ways to crack into your data. Watch this exclusive 15 minute video to learn the most critical elements of securing your SQL Server database.&#13;\n    <\/p>&#13;\n  <\/span>&#13;\n  <div style=\"clear:both\"><\/div>&#13;\n<\/div>&#13;\n<\/a>&#13;\n<\/div><\/div><div id='wp_cta_2930_variation_5' class='inbound-cta-container wp_cta_content wp_cta_variation wp_cta_2930_variation_5' style='display:none; margin:auto; width: px; height: px;'  data-variation='5' data-cta-id='2930'><div class=\"blank-cta-template\">&#13;\n\t<a href=\"https:\/\/sqlity.net\/inbound\/u0i1lo96\" style=\"text-decoration: none;\" rel=\"nofollow\">&#13;\n<div style=\"margin:10px 0;padding:5px;border:1px solid #196db6; border-radius:5px;\">&#13;\n  <span style=\"float:left; margin-right: 10px\">&#13;\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/F-300x214.jpg\" alt=\"F\" width=\"300\" height=\"214\" class=\"alignnone size-medium wp-image-2926\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/F-300x214.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/F-150x107.jpg 150w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/F.jpg 450w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/img>&#13;\n  <\/span>&#13;\n  <span>&#13;\n  <p style=\"margin-top:10px;\">&#13;\n<code style=\"font-weight:bold;color:#006699\">Is your database security leaky?<\/code><br><\/br><br><\/br>&#13;\nDon't let your data spill out onto the Internet! Watch this exclusive 15 minute video to learn the most critical elements of securing your SQL Server database.&#13;\n    <\/p>&#13;\n  <\/span>&#13;\n  <div style=\"clear:both\"><\/div>&#13;\n<\/div>&#13;\n<\/a>&#13;\n<\/div><\/div><div id='wp_cta_2930_variation_6' class='inbound-cta-container wp_cta_content wp_cta_variation wp_cta_2930_variation_6' style='display:none; margin:auto; width: px; height: px;'  data-variation='6' data-cta-id='2930'><div class=\"blank-cta-template\">&#13;\n\t<a href=\"https:\/\/sqlity.net\/inbound\/2o7l683\" style=\"text-decoration: none;\" rel=\"nofollow\">&#13;\n<div style=\"margin:10px 0;padding:5px;border:1px solid #196db6; border-radius:5px;\">&#13;\n  <span style=\"float:left; margin-right: 10px\">&#13;\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/G-300x300.jpg\" alt=\"G\" width=\"300\" height=\"300\" class=\"alignnone size-medium wp-image-2921\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/G-300x300.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/G-150x150.jpg 150w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/G-50x50.jpg 50w, https:\/\/sqlity.net\/wp-content\/uploads\/2015\/10\/G.jpg 450w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/img>&#13;\n  <\/span>&#13;\n  <span>&#13;\n  <p style=\"margin-top:10px;\">&#13;\n<code style=\"font-weight:bold;color:#006699\">An army of threats await your database!<\/code><br><\/br><br><\/br>&#13;\nIs your database secure? Watch this exclusive 15 minute video to learn the most critical elements of securing your SQL Server database.&#13;\n    <\/p>&#13;\n  <\/span>&#13;\n  <div style=\"clear:both\"><\/div>&#13;\n<\/div>&#13;\n<\/a>&#13;\n<\/div><\/div><\/div>\n<!--\/AD--><\/p>\n<p>\nSo all we need to do now to identify the service account of a SQL Server instance is to run a select statement like this:\n<\/p>\n<div>\n[sql]\nSELECT  DSS.servicename,<br \/>\n        DSS.startup_type_desc,<br \/>\n        DSS.status_desc,<br \/>\n        DSS.last_startup_time,<br \/>\n        DSS.service_account,<br \/>\n        DSS.is_clustered,<br \/>\n        DSS.cluster_nodename,<br \/>\n        DSS.filename,<br \/>\n        DSS.startup_type,<br \/>\n        DSS.status,<br \/>\n        DSS.process_id<br \/>\nFROM    sys.dm_server_services AS DSS;<br \/>\n[\/sql]\n<\/div>\n<p>\nExecuted on my local instance it returns this result:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/01\/sys.dm_server_services_in_action.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/01\/sys.dm_server_services_in_action.jpg\" alt=\"sys.dm_server_services in Action\" width=\"960\" height=\"588\" class=\"aligncenter size-full wp-image-1869\" \/><\/a>\n<\/p>\n<p>\nAs you can see, it returns not only the service account for the SQL Server service but also for the SQL Server Agent and the SQL Server Full-Text daemon. Besides of that a lot of additional useful information is returned.\n<\/p>\n<h3>Summary<\/h3>\n<p>\nBefore SQL Server 2008R2 SP1 there was no documented way to identify the SQL Server service account of an instance by just using T-SQL. Since then however we can use <span class=\"tt\">sys.dm_server_services<\/span> to get to that account name, not only for the SQL Server service but also for other related services like the SQL Server Agent service.\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In SP1 for SQL 2008R2 a new DMV was introduced: sys.dm_server_service. It provides information about SQL related services including the service account name. Read on to get all the details.<\/p>\n<p> <a href=\"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/\">[more&#8230;]<\/a><\/p>\n","protected":false},"author":3,"featured_media":1869,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[5,34],"tags":[38,58,86,84,85,83,87],"class_list":["post-1868","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general","category-security","tag-security-2","tag-security-management","tag-sql-server-agent","tag-sql-server-agent-service-account","tag-sql-server-service","tag-sql-server-service-account","tag-startup-time"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to identify the SQL Server Service Account in T-SQL - sqlity.net<\/title>\n<meta name=\"description\" content=\"In SP1 for SQL 2008R2 a new DMV was introduced: sys.dm_server_service. It provides information about SQL related services including the service account name. Read on to get all the details.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to identify the SQL Server Service Account in T-SQL - sqlity.net\" \/>\n<meta property=\"og:description\" content=\"In SP1 for SQL 2008R2 a new DMV was introduced: sys.dm_server_service. It provides information about SQL related services including the service account name. Read on to get all the details.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/\" \/>\n<meta property=\"og:site_name\" content=\"sqlity.net\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sqlity.net\" \/>\n<meta property=\"article:published_time\" content=\"2014-01-23T16:00:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-10-26T21:58:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/01\/sys.dm_server_services_in_action-e1445742932968.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"588\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sebastian Meine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sqlity\" \/>\n<meta name=\"twitter:site\" content=\"@sqlity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sebastian Meine\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/\"},\"author\":{\"name\":\"Sebastian Meine\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"headline\":\"How to identify the SQL Server Service Account in T-SQL\",\"datePublished\":\"2014-01-23T16:00:08+00:00\",\"dateModified\":\"2015-10-26T21:58:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/\"},\"wordCount\":450,\"commentCount\":2,\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/sys.dm_server_services_in_action-e1445742932968.jpg\",\"keywords\":[\"security\",\"security management\",\"SQL Server Agent\",\"SQL Server Agent Service Account\",\"SQL Server Service\",\"SQL Server Service Account\",\"Startup Time\"],\"articleSection\":[\"General\",\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/\",\"name\":\"How to identify the SQL Server Service Account in T-SQL - sqlity.net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/sys.dm_server_services_in_action-e1445742932968.jpg\",\"datePublished\":\"2014-01-23T16:00:08+00:00\",\"dateModified\":\"2015-10-26T21:58:21+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"description\":\"In SP1 for SQL 2008R2 a new DMV was introduced: sys.dm_server_service. It provides information about SQL related services including the service account name. Read on to get all the details.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/sys.dm_server_services_in_action-e1445742932968.jpg\",\"contentUrl\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/sys.dm_server_services_in_action-e1445742932968.jpg\",\"width\":960,\"height\":588},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1868\\\/identify-sql-server-service-account-in-t-sql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to identify the SQL Server Service Account in T-SQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\",\"name\":\"sqlity.net\",\"description\":\"Quality for SQL\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sqlity.net\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\",\"name\":\"Sebastian Meine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"caption\":\"Sebastian Meine\"},\"sameAs\":[\"http:\\\/\\\/sqlity.net\",\"https:\\\/\\\/x.com\\\/sqlity\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to identify the SQL Server Service Account in T-SQL - sqlity.net","description":"In SP1 for SQL 2008R2 a new DMV was introduced: sys.dm_server_service. It provides information about SQL related services including the service account name. Read on to get all the details.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/","og_locale":"en_US","og_type":"article","og_title":"How to identify the SQL Server Service Account in T-SQL - sqlity.net","og_description":"In SP1 for SQL 2008R2 a new DMV was introduced: sys.dm_server_service. It provides information about SQL related services including the service account name. Read on to get all the details.","og_url":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/","og_site_name":"sqlity.net","article_publisher":"https:\/\/www.facebook.com\/sqlity.net","article_published_time":"2014-01-23T16:00:08+00:00","article_modified_time":"2015-10-26T21:58:21+00:00","og_image":[{"width":960,"height":588,"url":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/01\/sys.dm_server_services_in_action-e1445742932968.jpg","type":"image\/jpeg"}],"author":"Sebastian Meine","twitter_card":"summary_large_image","twitter_creator":"@sqlity","twitter_site":"@sqlity","twitter_misc":{"Written by":"Sebastian Meine","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/#article","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/"},"author":{"name":"Sebastian Meine","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"headline":"How to identify the SQL Server Service Account in T-SQL","datePublished":"2014-01-23T16:00:08+00:00","dateModified":"2015-10-26T21:58:21+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/"},"wordCount":450,"commentCount":2,"image":{"@id":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/01\/sys.dm_server_services_in_action-e1445742932968.jpg","keywords":["security","security management","SQL Server Agent","SQL Server Agent Service Account","SQL Server Service","SQL Server Service Account","Startup Time"],"articleSection":["General","Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/","url":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/","name":"How to identify the SQL Server Service Account in T-SQL - sqlity.net","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/#primaryimage"},"image":{"@id":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/01\/sys.dm_server_services_in_action-e1445742932968.jpg","datePublished":"2014-01-23T16:00:08+00:00","dateModified":"2015-10-26T21:58:21+00:00","author":{"@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"description":"In SP1 for SQL 2008R2 a new DMV was introduced: sys.dm_server_service. It provides information about SQL related services including the service account name. Read on to get all the details.","breadcrumb":{"@id":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/#primaryimage","url":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/01\/sys.dm_server_services_in_action-e1445742932968.jpg","contentUrl":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/01\/sys.dm_server_services_in_action-e1445742932968.jpg","width":960,"height":588},{"@type":"BreadcrumbList","@id":"https:\/\/sqlity.net\/en\/1868\/identify-sql-server-service-account-in-t-sql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sqlity.net\/en\/"},{"@type":"ListItem","position":2,"name":"How to identify the SQL Server Service Account in T-SQL"}]},{"@type":"WebSite","@id":"https:\/\/sqlity.net\/en\/#website","url":"https:\/\/sqlity.net\/en\/","name":"sqlity.net","description":"Quality for SQL","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sqlity.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c","name":"Sebastian Meine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","caption":"Sebastian Meine"},"sameAs":["http:\/\/sqlity.net","https:\/\/x.com\/sqlity"]}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXuw-u8","jetpack-related-posts":[],"jetpack_featured_media_url":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/01\/sys.dm_server_services_in_action-e1445742932968.jpg","_links":{"self":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/comments?post=1868"}],"version-history":[{"count":0,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1868\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media\/1869"}],"wp:attachment":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media?parent=1868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/categories?post=1868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/tags?post=1868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}