Netusergetinfo is returning 2221(user not found) error code for valid user on Win2003 active directory. The user is valid and present in the active directory. The process which is making a call to netusergetinfo is running under account SYSTEM. My guess is it due to some permissions/settings on active directory but I am not aware of it. Anyone has ideas?
Yes, the problem was with servername parameter that we were passing to Netusergetinfo
We were getting it from call to function NetGetDCName and if that function failed we were siliently setting the servername to NULL.
Due to this Netusergetinfo was trying to enumerate local users which resulted in 2221 'user not found error'
The function NetGetDCName was failing with error code 2453 NERR_DCNotFound.
This is due to incorrect DNS settings on the host due to which it is unable to lookup the primary domain controller.
Just a thought, but make sure the
You might also consider using ADSI instead for hooking into AD.