Find Names of Local Accounts on Devices

When you add devices to JumpCloud and you want to take over existing local accounts, you need to match the JumpCloud username or the local user account field with the name of the local account. If they don’t match, a new profile is created on the device. Use this article to learn about the different methods you can use to find the name of existing local accounts on devices.

Manually Finding the Names of Local Accounts on Devices

If you have a small set of devices, you can manually find the name of existing accounts on Windows, Linux, and Mac devices. 

Linux

To manually find the name of an existing account on a Linux device: 

  1. Go to Settings > Users. All users are listed horizontally at the top.
  2. Select one and unlock to change settings and/or add users. 

Tip:

Another option to find local user names for each Linux device is to use the following command: cat /etc/passwd.

Mac

To manually find the name of an existing account on a macOS device:

  1. Go to System Settings > Users & Groups.
  2. Select a user, right-click, then choose Advanced Options…

Note:

Account Name is the name of the local account. On macOS Ventura, this field is called User Name. 

Windows

To manually find the name of an existing account on a Windows device, go to Control Panel > Administrative Tools Computer Management > Local Users and Groups > Users.

Note:

Name is the local account’s name. 

Using the Device Agent to Query and Find Local Account Profiles

If you have plans to take over existing accounts on a large number of devices, automate the process and use the device agent to query and find local account profiles. 

Prerequisites:

To query profiles on Windows and Mac devices

  1. Import the following commands to the Admin Portal with the PowerShell Module.
  2. Run the imported commands from the Admin Portal. Note: When you run commands in the JumpCloud Admin Portal, they only produce outputs for devices that are currently online and checking in. To run the commands from the Admin Portal:
    1. Log in to the JumpCloud Admin Portal
    2. Go to DEVICE MANAGEMENT > Commands.
    3. Click the imported commands to open the Commands panel. 
    4. Go to the Device Groups or Devices tab, then select the device groups and devices you want to run the command on. Note: Make sure to select Windows devices and device groups for the Windows command and Mac device and Mac device groups for the Mac command. 
    5. Click save.
    6. To run the commands, select the checkbox for each command, then click run now. This creates a lot of command results because a command result is produced for each system. Don’t delete these command results.
  3. From the JumpCloud PowerShell Module, export the command results to a CSV using the following commands. The Windows command is listed first, and the Mac command is listed second.

$CommandName="Windows - List All Users | v1.0 JCCG"
Get-JCCommandResult | Where-Object Name -Like "$CommandName"  | Get-JCCommandResult -ByID | Select-Object name, system, systemId, exitCode, output | Export-CSV "WindowsUsers.csv"

$CommandName="Mac - List All Users | v1.0 JCCG"
Get-JCCommandResult | Where-Object Name -Like "$CommandName"  | Get-JCCommandResult -ByID | Select-Object name, system, systemId, exitCode, output | Export-CSV "MacUsers.csv"

After you run these commands, you have CSV files with comprehensive lists of all local accounts on your Mac and Windows devices. Now you can:

Back to Top

List IconIn this Article

Still Have Questions?

If you cannot find an answer to your question in our FAQ, you can always contact us.

Submit a Case