The easiest method of executing this sample is to paste the code inside the sample code of Opening networks and locating readers example, just after the number of users is displayed, but before the Logoff method is called.
Refer to IUser for more properties of a single user.
// Assume that oReader holds a valid logged-on reader object. // Collect all users (this may take some time....) oReader.UserDatabase.CollectUsers(); // Copy all users to another object (only for readability) var oUsers = oReader.UserDatabase.Users; WScript.Echo("Number of collected users: " + oUsers.Count); // Start with the first item in the collection var oUser = oUsers.FirstItem; while (oUser) { // Display a messagebox with the text WScript.Echo("User: " + oUser.Name + ", Card: " + oUser.CardNumber + ", Level: " + oUser.LevelDescription + ", Card: " + oUser.CardTypeDescription); // Get the next item in the collection oUser = oUsers.NextItem; }