FindUserName Returns ERROR_FILE_NOT_FOUND Instead of S_OK (274723)



The information in this article applies to:

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional

This article was previously published under Q274723

SYMPTOMS

There is an issue that involves the use of the FindUser method on the DiskQuota scripting object. When a logon name is provided for a user whose SID-Name pair is not yet in the operator's SID-Name cache, the FindUser method returns HRESULT_FROM_WIN32 (ERROR_FILE_NOT_FOUND) rather than S_OK as documented in the Software Development Kit (SDK).

CAUSE

The problem is in the C++ IDiskQuotaControl::FindUserName method and the corresponding scripting FindUser method, both of which are implemented in Dskquota.dll.

If the logon name that is provided to the method is for a valid user but there is no entry in the disk quota SID-Name cache for that user, the method returns HRESULT_FROM_WIN32 (ERROR_FILE_NOT_FOUND) rather than S_OK as documented in the SDK. If there is an entry in the SID-Name cache for that user, the method returns S_OK as required.

RESOLUTION

To resolve this problem, obtain the latest service pack for Windows 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

260910 How to Obtain the Latest Windows 2000 Service Pack

WORKAROUND

You can call the DiskQuota scripting TranslateLogonNameToSid method to obtain a SID string for the user. That string can be passed to "FindUser" rather than the name. This results in "FindUser" succeeding with S_OK.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Windows 2000 Service Pack 2.

MORE INFORMATION

This issue does not affect users of the Windows 2000 Disk Quota tool. It may affect developers or system administrators who want to use this call in the development of a quota tool or in script-based management.

Modification Type:MajorLast Reviewed:11/14/2003
Keywords:kbbug kbfix kbWin2000PreSP2Fix KB274723