Hi,
I have a Windows service running as LocalSystem that needs to access some network resources. I found a way to impersonate a user that is currently logged on, by retrieving the token with OpenProcessToken
, duplicating it and calling WindowsIdentity.Impersonate
. That way I can access the same network resources as the impersonated user.
However, that means my service will only work if there is a logged on user... So I was thinking that, since the LocalSystem has all privileges on the machine, perhaps it can impersonate a user that is not currently logged on ? Or log on as any (local) user without knowing its password ? Assuming it's possible, how can I do it ?
Thanks in advance for any help