Using CreateProcessWithLogonW with an administrator on Windows 11

68 Views Asked by At

I have an application we use to deploy software on client computers. Users don't have administrator rights, so our application runs the installer with an administrator account using the 'CreateProcessWithLogonW' function. In Widows 10, this worked great. We now have some Windows 11 computers. ON windows 11, when I (for example) launch cmd with a domain admin using 'CreateProcessWithLogonW', I don't see the 'administrator' thing in the title bar, so the cmd is run but not as administrator.

If I right click on cmd and use 'Run as administrator', using the same domain admin account it does work as expected and 'Administrator' is in the title bar of cmd.

I never had this issue on a Windows 10. Normally CreateProcessWithLogonW would fail (wrong account credentials, ...) or it would work. Never had I an issue like on Windows 11 where I want to run something as domain admin but it isn't run with administrator rights.

Something seems completely different on a Windows 11. Can somebody point out what? Is there a workaround? I can, if necessary, change my code to an other function to run a process with admin rights.

Thanks in advance.

0

There are 0 best solutions below