Impersonation and Access Rights

I need to enumerate network resources from my service and for this i plan to use impersonation.
This is what i did.

LogonUser(username)
ImpersonateLoggedOnUser()

// do networking stuff

RevertToSelf()

when i perform these operations with username = Administrator, the networking code works fine but with username = xxxx (which belong to the Administrators group), the networking code fails (GetLatError = 2).

What am i doing wrong here
As i see the username(xxxx) does not have a few access rights or privileges which the Administrator has to enumerate network resources. any idea what are those rights or privileges

I tried with granting SeNetworkLogonRight to xxxx and it did not work.

any inputs will be helpful.




Answer this question

Impersonation and Access Rights