question

NavaneethR-8522 avatar image
0 Votes"
NavaneethR-8522 asked XiaopoYang-MSFT edited

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://docs.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

windows-apic++
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is the Domain Admin in the local Windows Admin group on the remote node?

0 Votes 0 ·

It is the Active Directory Domain Admin account.
I believe, this Domain Admin user can able to perform all kind of operations on remote machine.

0 Votes 0 ·

OK. Could you please show a minimal, reproducible sample without private information?

0 Votes 0 ·

0 Answers