Domanda

I have a list of usernames. In C++ which way would it be better to check if the profile associated with the username exists or deleted in the local machine? I came across ATL CAccessToken class methods and Win32 APIs with GetTokenInformation etc. Which one would be better on performance perspective too?

È stato utile?

Soluzione

I would expect that performance-wise a single call to gather the entire list of all users would be faster than verifying them individually. You can do that using the NetUserEnum function as described here. This will also get you the status flags so you know if the user account has been disabled, locked out, their password expired, etc.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top