FILEEN32 (located in \TOOLKIT\SAMPLES\LANSERV\FILEEN32) returns information on open files on a specific server. You can choose to view a list of all open files or to restrict the list by device path or user. You can leave both the path and the user ID unspecified to get information on all files opened by all users on the specified server.
FILEEN32 demonstrates how to use the following NetAPI function: Net32FileEnum2.