OpenSCManager remote request failed 5 access denied

I am writing a script that periodically checks that certain services are running on remote workstations. I have a hell of a time when the command "SC \ workst1 query" runs from one test machine to another. Both machines are running XP pro SP3. None of them are part of the domain. Both are in the same workgroup, and the administrator accounts have the same passwords.

I continue to receive the message "[SC] OpenSCManager FAILED 5: Access is denied" from any workstation to another. I tried using elevated privileges for both. Windows Firewall software is disabled. There are no messages in the security event logs. When (as an administrator) I try to go to "Computer Management" → "connect to another computer" and get access to the remote services that I get "Error 5 Access is denied."

I can successfully set the file system share between the two machines, and "net use \ workst1 \ IPC $ / user: Administrator" succeeds, but the SC request still fails. I use IP addresses, not hostnames in these commands, but this does not help. I do not know what else to try. Thanks for the help.

+10
cmd windows-xp permissions mmc
Nov 01 '13 at 15:56
source share
5 answers

Try running commands as an administrator

start-> (enter cmd in the search field), right-click on cmd , Run as administrator → run the command

+15
May 6 '15 at 20:49
source share
— -

You must have administrator rights on the remote computer. In addition, you must access the disk before calling sc. This can be done on the command line using

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

admin $ is a hidden shared drive available to administrators that sc uses to manage services.

+14
Jun 11 '15 at 17:41
source share

I had the same issue today, trying to check if the service is enabled remotely. I could solve the problem of changing user account control for remote restrictions in windows:

To disable remote UAC restrictions, follow these steps:

  • Click Start, click Run, type regedit and then press ENTER.
  • Locate and highlight the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  • If the LocalAccountTokenFilterPolicy registry LocalAccountTokenFilterPolicy does not exist, follow these steps:
    From the Edit menu, select New , and then click DWORD Value . Type LocalAccountTokenFilterPolicy and then press ENTER. Right-click LocalAccountTokenFilterPolicy and select Modify . In the Value field, enter 1 and click OK.
  • Close the registry editor.

Read more about this decision in this site .

+4
May 31 '17 at 21:30
source share

Your user must be removed from the Manager and local users and groups

0
Nov 06 '13 at
source share

The problem with UAC is obvious: you have to press the lever to configure UAC. Also, when installing services, you can use the following command

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

0
Dec 11 '18 at 21:43
source share



All Articles