Getting all users in machine

Raja Shanmugam 21 Reputation points
2021-06-02T12:12:49.203+00:00

i am trying to get all users in a machine using the following uwp api
Windows.System.User.FindAllAsync

This api is giving only the current logged in user in the machine.

Is there a way to get all users of a machine?

Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. AryaDing-MSFT 2,916 Reputation points
    2021-06-03T03:18:37.697+00:00

    Hi,

    Welcome to Microsoft Q&A!

    Currently, uwp provides FindAllAsync method returns the user that is currently logged-in and using the app for most devices, it doesn't return all the accounts on the machine. There is DirectoryEntry class under System.DirectoryServices namespace could get all users of a machine, but the System.DirectoryServices is not supported on uwp. So maybe you need to create a win32 app uses the System.DirectoryServices and package it into uwp app, then you could use FullTrustProcessLauncher Class to call this win32 app.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.