Category filter

Script to list Windows local user accounts

Administrators need to keep tab on users accounts in their corporate devices for effective user management. Hexnode users can deploy scripts to get the details of all the users on a Windows device. Deploying scripts is one of the useful methods to view user details of accounts from Windows devices located remotely.

Note:


Supported Versions:

The scripts given below will be supported on the following versions:

  • Windows 10 v1607+ (Pro, Enterprise, Education)
  • Windows 11 (Pro, Enterprise, Education)

Disclaimer:


The sample scripts provided below are adapted from third-party open-source sites.

Batch Script

Batch script to list Windows local user accounts remotely executed successfully from Hexnode.

PowerShell Script

PowerShell script to list Windows local user accounts remotely executed successfully from Hexnode.

How to View Script Output in Hexnode

To review the execution results, navigate to the Action History tab of the specific device in your Hexnode UEM portal. Locate the script entry in the Subject column and click the Show Output button next to the status field to view the returned data.

Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

Sample Script Repository