service-control-manager

Remote OpenSCManager fails with access denied

半世苍凉 提交于 2020-01-01 17:11:54
问题 I am attempting to control a service on a remote machine using the following code: // Error checking omitted for brevity HANDLE hToken = NULL; // user = username with no domain specification // domain = targetmachine when targetting computer outside of domain LogonUser(user, domain, password, LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_WINNT50, &hToken); ImpersonateLoggedOnUser(hToken); SC_HANDLE hSc = OpenSCManager(targetmachine, SERVICES_ACTIVE_DATABASE, SC_MANAGER_ALL_ACCESS); This

Didn't receive SERVICE_CONTROL_SHUTDOWN

女生的网名这么多〃 提交于 2019-12-13 02:31:50
问题 Is there any scenario that SCM won't deliver SERVICE_CONTROL_SHUTDOWN to all services or service is not able to receive SERVICE_CONTROL_SHUTDOWN ? I tried to search this on internet but I didn't find any related articles or discussion. The issue of service didn't receive SERVICE_CONTROL_SHUTDOWN is happened mostly on Windows 7 X64 with anti-malware installed while OS shutting down. Our service have called SetServiceStatus with the SERVICE_ACCEPT_SHUTDOWN 来源: https://stackoverflow.com

remote sc OpenSCManager query failed 5 access denied

荒凉一梦 提交于 2019-12-09 08:38:37
问题 I'm writing a script that periodically checks that certain services are running on remote workstations. I'm having a devil of a time getting an "SC \workst1 query" command working from one test machine to another. Both machines are running XP pro SP3. Neither is part of a domain. Both are in the same workgroup, and the administrator accounts have the same passwords. I keep getting the "[SC] OpenSCManager FAILED 5: Access is denied" message, from either workstation to the other. I have tried

remote sc OpenSCManager query failed 5 access denied

无人久伴 提交于 2019-12-03 11:07:01
I'm writing a script that periodically checks that certain services are running on remote workstations. I'm having a devil of a time getting an "SC \workst1 query" command working from one test machine to another. Both machines are running XP pro SP3. Neither is part of a domain. Both are in the same workgroup, and the administrator accounts have the same passwords. I keep getting the "[SC] OpenSCManager FAILED 5: Access is denied" message, from either workstation to the other. I have tried using elevated privileges on both. Windows firewall software is turned off. There are no messages are