Access Denied in Windows Command Prompt

Nathan Chen 20 Reputation points
2023-01-17T02:44:29.8933333+00:00

Good day,

I am attempting to run the following command in CMD:

sc managedaccount mpssvc false

However, an error message is returned stating: [SC] OpenService FAILED 5: Access is denied.

I am an administrator and I ran the command prompt as an administrator. Please assist me in resolving this issue. Thank you.

Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 36,291 Reputation points
    2023-01-18T00:28:56.17+00:00

    Not sure how this might have happened

    To Dave's point, do you have an idea how that got changed? If you don't, then my concern would be that other settings have been changed and even if you get that reset you might be fighting other oddities. In that case it might be safer to put up a new server as he suggested.

    You can try psexec. That will let you run a command as the system account.

    [https://learn.microsoft.com/en-us/sysinternals/downloads/psexec

    psexec \\localhost -s sc config mpssvc obj= "NT Authority\LocalService"
    
    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. MotoX80 36,291 Reputation points
    2023-01-17T16:58:49.58+00:00

    Why do you want to run that command?

    The firewall should be set to run as LocalService.

    C:\>sc qc mpssvc
    [SC] QueryServiceConfig SUCCESS
    
    SERVICE_NAME: mpssvc
            TYPE               : 20  WIN32_SHARE_PROCESS
            START_TYPE         : 2   AUTO_START
            ERROR_CONTROL      : 1   NORMAL
            BINARY_PATH_NAME   : C:\WINDOWS\system32\svchost.exe -k LocalServiceNoNetworkFirewall -p
            LOAD_ORDER_GROUP   : NetworkProvider
            TAG                : 0
            DISPLAY_NAME       : Windows Defender Firewall
            DEPENDENCIES       : mpsdrv
                               : bfe
            SERVICE_START_NAME : NT Authority\LocalService
    
    C:\>
    

    Did you try to configure the service to run as a managed account?

    An educated guess would be that the Windows Defender has a self protection mechanism that is blocking you. You could try turning Defender off temporarily or maybe boot into safe mode.

    https://www.bing.com/search?q=how%20to%20temporarily%20disable%20windows%20defender


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.