remote sc OpenSCManager query failed 5 access denied

无人久伴 提交于 2019-12-03 11:07:01

Try to run the commans as a Administrator

start-> (type cmd in search box), right click on cmd, Run as a administrator -> execute your command

You must have administrative rights on the remote machine. Moreover you must access the drive before calling "sc". This can be achieved in command line using

net use \\remotemachine\admin$ <password> /user:<username>

admin$ is a hidden shared drive accessible to administrators that "sc" uses to control services.

afonte

I was having the same issue today trying to check if a service is enabled remotely. I could solve the issue modifying the User Account Control for remote restrictions in windows:

To disable UAC remote restrictions, follow these steps:

  1. Click Start, click Run, type regedit, and then press ENTER.
  2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  3. If the LocalAccountTokenFilterPolicy registry entry does not exist, follow these steps:
    On the Edit menu, point to New, and then click DWORD Value. Type LocalAccountTokenFilterPolicy, and then press ENTER. Right-click LocalAccountTokenFilterPolicy, and then click Modify. In the Value data box, type 1, and then click OK.
  4. Exit Registry Editor.

More information about this solution in this site.

Your user should be remote, from Manage and Local users and groups

The UAC issue is obvious you have to pull down the lever for UAC setting Also while installing the services you can use the following command

SC create SERVICENAME DisplayName= "DISPLAYNAME" binPath= "PATH OF EXE" start= disabled type= share

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!