Published on

March 16, 2015

Exploring SQL Server Startup Account with WMIC

Friends are an important part of our lives, and they often bring interesting topics of discussion. Recently, I had a conversation with a friend who mentioned a method to find details about the SQL Server startup account using WMIC. Intrigued by this statement, I decided to delve deeper into the topic and share my findings with my blog readers.

So, what exactly is WMIC? WMIC stands for Windows Management Instrumentation Command. In simple terms, WMIC is a utility that allows us to interact with WMI (Windows Management Instrumentation) from a WMI-aware command-line shell. It provides a powerful console through which we can access all WMI objects, their properties, and methods.

WMIC has a parameter for service application management, which is particularly useful for retrieving information about SQL Server services. By using the “where” clause and the “get” method, we can obtain details about services related to SQL Server.

Here are the naming conventions for SQL Server services:

  • SQL Server – Default Instance: SQL Server (MSSQLSERVER)
  • SQL Server – Named Instance: SQL Server (NameOfInstance)
  • SQL Server Agent – Default Instance: SQL Server Agent (MSSQLSERVER)
  • SQL Server Agent – Named Instance: SQL Server Agent (NameOfInstance)
  • SQL Server Browser: SQL Server Browser
  • SQL Server Full text – Default Instance: SQL Full-text Filter Daemon Launcher (MSSQLSERVER)
  • SQL Server Full text – Named Instance: SQL Full-text Filter Daemon Launcher (NameOfInstance)

You can extend this list to include services for Reporting Services, Analysis Services, and more.

Now, let’s take a look at the WMI query that can list services using the “like” operator. If you are familiar with T-SQL, you would know that “%” is the wildcard operator.

wmic service where "name Like '%MSSQL%' or name like '%SQL%Agent%'" get Name, StartName

When you run this query, you will get an output similar to the following:

Name                                      StartName
SQL Server (MSSQLSERVER)                   NT AUTHORITY\NETWORKSERVICE
SQL Server Agent (MSSQLSERVER)             NT AUTHORITY\NETWORKSERVICE

Isn’t it fascinating? I encourage you to try this query in your own environments and see what results you get. The learning never stops, and there’s always something new to discover in the world of SQL Server.

Stay tuned for more exciting SQL Server tips and tricks in my upcoming blog posts!

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.