mattjohnsonpint/SimpleImpersonation

Impersonate to guest

Elektrik1 opened this issue · 1 comments

Hello,

I have rather a strange issue, I need to ensure user connects to network share with Guest account (passwordless), even if other user is stored in windows credentials. I have tried to RunAsUser Guest with no password, but package does allow this. Is there any solution?

SimpleImpersonation relies on the underlying LogonUser Win32 API. It has no magic of its own. It's just a wrapper to make it easier to use from .NET.

My understanding is that when guest accounts are enabled, LogonUser will accept anything. Various examples show "dummyuser" "dummypassword", etc. I'm not an expert in this area, but if that is indeed the case then you could pass such values through this wrapper. Probably anything but null/empty will work. (I make no guarantees though.)