Hi! Is there a way to get a list of all administrator accounts on my device? Any suggestions?
Hi! Is there a way to get a list of all administrator accounts on my device? Any suggestions?
Hi @wilma!
You can retrieve the list of administrator accounts using a simple command. Run the following in the Windows Command Prompt:
|
1 |
net localgroup Administrators |
Alternatively, you can use PowerShell with the following command:
|
1 |
Get-LocalGroupMember Administrators |
Hi @wilma,
The commands suggested by @emersyn are spot on. I’d like to suggest another approach that might be helpful as well. You can use the following PowerShell script to get a detailed list of admin accounts on your Windows device:
|
1 2 3 4 5 6 7 |
# Get a list of local groups that have administrators $adminGroup = Get-LocalGroupMember -Group "Administrators" # Output the members of the administrators group Write-Host "Users with administrator privileges:" foreach ($user in $adminGroup) { Write-Host $user.Name } |
If your Windows device is enrolled in Hexnode UEM, you can use the Execute Custom Script remote action to retrieve the list of admin accounts. Otherwise, you can run the script using Windows Terminal.
Hope this helps! Let me know if you have any further questions.
Regards,
Ben Clarke
Hexnode UEM
Don't have an account? Sign up