Share via

Inventory in windows domain

Andy 1,026 Reputation points
2023-11-14T08:01:07.97+00:00

Hello,

Is it possible to list users who are logged on to computers in the Windows domain or have a local profile created,preferably in a table where users are in one column and the computers where these users are logged in are in the other.

Thank you

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

2 answers

Sort by: Most helpful
  1. JimmySalian-2011 45,371 Reputation points Volunteer Moderator
    2023-11-14T10:14:54.8933333+00:00

    Hi,

    Probably something like this you are looking but will require some changes to the script to customise according to your requiremetns - https://4sysops.com/archives/how-to-find-a-logged-in-user-remotely-using-powershell/

    But this is a good start and gather data in the initial stage.

    Hope this helps.

    JS

    ==

    Please Accept the answer if the information helped you. This will help us and others in the community as well.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Rich Matheisen 48,116 Reputation points
    2023-11-14T16:15:52.8266667+00:00

    If you're interested in finding out who's ever logged on to a machine, you can get that information from the registry on each machine. Or you can use WMI or CIM to get the information from the Win32_UserProfile class. An example of using WMI/CIM can be found here: https://devblogs.microsoft.com/scripting/use-powershell-to-find-user-profiles-on-a-computer/

    The profile names are the users' SID. WMI/CIM makes it a bit easier get the users' names (provided you don't reuse AD users by simply renaming them (that won't change the SID, but the name of the user won't match the name of the profiles' directory -- and that may be confusing).

    Was this answer helpful?

    0 comments No comments

Your answer

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