2

I'm working on a new SQL Server instance, but the SSMS options to start/stop/restart the SQL Agent are grayed out.

I am connected from another PC. My user is in a group that has sysadmin permissions and is in the server's Administrators group. I thought that would be enough.

What permission is needed to get this option?

enter image description here

enter image description here

3
  • If a) you can RDP to the server, and b) it has SSMS installed, would these commands be available - while logged-in under the same SQL credentials? Commented Feb 11 at 15:59
  • @Astrogator Yes and Yes. Commented Feb 11 at 16:39
  • In that case follow already given answers. Commented Feb 11 at 17:07

2 Answers 2

4

What permission is needed to get this option?

You need all Windows level permissions (high level):

  • WMI connectivity
  • WMI namespace
  • Windows Service(s)

If you're attempting this from a remote machine, you'll also need the appropriate firewall rules for remote WMI.

Obviously being a local admin on the server will, by default if there are no previously included denies to your account, work as denoted by Doug's answer.

Regardless of being remote or not, the entire process is completed through WMI calls. Note that there can be a difference in WMI namespace usage depending on the instance being clustered or not.


To check remote WMI connectivity, see the documentation:


Example WMI call to get the agent service

GroupOperationId = 20145; Operation = Provider::GetObject - CIMWin32 : Win32_Service.Name="SQLSERVERAGENT"; HostID = 4316; ProviderName = CIMWin32; ProviderGuid = {d63a5850-8f16-11cf-9f47-00aa00bf345c}; Path = %systemroot%\system32\wbem\cimwin32.dll

Example of stopping the agent service

GroupOperationId = 20145; OperationId = 20144; ClassName= Win32_Service; MethodName = StopService; ImplementationClass = Win32_BaseService; ClientMachine = WIN-H5JAVS3QKT5; User = WIN-H5JAVS3QKT5\Administrator; ClientProcessId = 4184; NamespaceName = \.\root\cimv2

0
1

My user is in a group that has sysadmin permissions

It's not about sysadmin rights to the SQL instance. It's about Windows rights. The account you use to log in to SSMS and authenticate to the SQL instance needs to have admin rights on the Windows server that the SQL instance lives on.

See also: https://www.sqlservercentral.com/forums/topic/unable-to-startstop-sql-agent-remotely-through-ssms

1
  • See Sean Gallardy's answer for notes about other things that could be getting in the way. Commented Feb 10 at 22:40

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.