OpenSCManager API failed with AccessDenied for Remote Computer
Hi,
While trying to establish a connection to the Service Control Manager on Remote Computer using OpenSCManagerA( ), it's failed with Access Denied.
This API succeeds when I execute this command with user session. When I run this command with SYSTEM session, it fails.
https://learn.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-openscmanagera
In the above document, the following is mentioned
"To connect to a service remotely, call the LogonUser function with LOGON32_LOGON_NEW_CREDENTIALS and then call ImpersonateLoggedOnUser before calling OpenSCManager."
As mentioned above, I tried impersonating as Domain Admin with LOGON32_LOGON_NEW_CREDENTIALS before calling OpenSCManagerA( ) API. But still it is failed with Access denied error.
Tried enabling and disabling UAC on Remote computer, uninstalled Anti Virus on source machine and remote machine, no software restriction policy configured.
But still no luck.
This issue occurs only on Windows 10 machines!
Is there anyway to execute OpenSCManager API in SYSTEM session? Could anyone help me?
Thanks and Regards,
Navaneeth R