Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List users available on a host #327

Open
daladim opened this issue Mar 25, 2021 · 2 comments
Open

List users available on a host #327

daladim opened this issue Mar 25, 2021 · 2 comments

Comments

@daladim
Copy link
Contributor

daladim commented Mar 25, 2021

I'd like to list the users "available" on a system, and get their home dirs. This is not available on heim, since heim::host::users() only lists currently logged in users

  • On windows, this is possible using NetUserEnum
  • On Linux, /etc/passwd looks suited, unless there is a better API.

I'm not sure yet what "available" means. Should we also list "special" users (SYSTEM, LOCAL_NETWORK, etc.) ? What should we list on a machine that is part of a Windows domain that has local and domain users?

I might try to implement something, but feel free to give your opinion on this first :-)

@daladim
Copy link
Contributor Author

daladim commented Mar 26, 2021

Hmm, NetUserEnum does not return the profile home dir (or rather, it does but it's an empty string, according to Manage this PC > Local Users and groups > Users > > double click > Profile tab > Home folder)...

@daladim
Copy link
Contributor Author

daladim commented Apr 1, 2021

It looks like using the WMI request SELECT * FROM Win32_UserProfile is a better choice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant