c# - LsaEnumerateAccountsWithUserRight fails when connecting to Windows Server 2008 r2 -


different for I have some C # code that uses "advapi32.dll" to document the purposes of various servers Could collect information.

Part of that document is getting user permission from each machine. I am using the LSAEnumerateAccountsWithUserRight function that works on Windows 2003 machines, but not on 2008 machines. I'm using an "access denied" received error I I had been read many threads recommended to disable the UAC (to whom I) and Elosopolisi (which I've tried) is using POLICY_VIEW_LOCAL_INFORMATION instead of POLICY_ALL_ACCESS and does not work with it is what led anyone into this problem?

What is it, I am able to use LsaLookupNames2 and LSAEnumerateAccountRights in Win2008 R2 (administrator mode VS is running).

  LsaOpenPolicy (... Access.POLICY_LOOKUP_NAMES |. POLICY_VIEW_LOCAL_INFORMATION, lsaHandle) out ... LSALookupNames2 (lsaHandle, 0, 1, name, ref   

I have used the following two contexts:

  • - is very good ...
  • - at least privilege LsaOpenPolicy , Marshall safely on the x64 system

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -