Solutions
Device management
Remotely manage, and protect laptops and mobile devices.
Orchestration
Automate tasks across devices, from app installs to scripts.
Software management
Inventory, patch, and manage installed software.
Fleet Gitops
See every change, under any error, repeat every success.
Extend Fleet
Integrate your favorite tools with Fleet.
More
Device management
Remotely manage, and protect laptops and mobile devices.
Orchestration
Automate tasks across devices, from app installs to scripts.
Software management
Inventory, patch, and manage installed software.
Fleet Gitops
See every change, under any error, repeat every success.
Extend Fleet
Integrate your favorite tools with Fleet.
Collects the local user accounts and their respective user group.
To learn more about queries, check this guide.
SELECT uid, username, type, groupname FROM users u JOIN groups g ON g.gid = u.gid;
$groupMapping = @{}
$localGroups = Get-LocalGroup -ErrorAction SilentlyContinue
foreach ($group in $localGroups) {
$members = Get-LocalGroupMember -Group $group.Name -ErrorAction SilentlyContinue
foreach ($member in $members) {
if ($member.ObjectClass -eq 'User') {
if (-not $groupMapping.ContainsKey($member.SID.Value)) {
$groupMapping[$member.SID.Value] = @()
}
$groupMapping[$member.SID.Value] += $group.Name
}
}
}
$users = Get-LocalUser -ErrorAction SilentlyContinue
$results = foreach ($user in $users) {
$userGroups = $groupMapping[$user.SID.Value]
[PSCustomObject]@{
uid = $user.SID.Value
username = $user.Name
type = 'Local'
groupname = if ($userGroups) { $userGroups -join ',' } else { 'N/A' }
}
}
$results | Format-Table -AutoSize
PowerShell commands are currently work in progress, contributions welcome.
Bash commands for macOS are currently work in progress, contributions welcome.
Apple
Windows
Linux
ChromeOS