user_accounts_report.ps1 - limehawk/rmm-scripts GitHub Wiki

user_accounts_report.ps1

Generates a comprehensive report of all local user accounts, group memberships, and profiles.

Overview

Property Value
Platform Windows
Version 1.0.0
Category User & Profile Management

Purpose

Generates a comprehensive report of all local user accounts, their group memberships, login sessions, and user profiles on the system. Provides a single view of all user-related information for auditing and troubleshooting.

Requirements

  • Windows 10/11 or Windows Server
  • PowerShell 5.1+
  • Admin privileges recommended for full details

Inputs

None - script reports on current system state.

Behavior

  1. Retrieves all local user accounts with details
  2. Queries group membership for each user
  3. Gets current active login sessions
  4. Lists all user profiles on disk
  5. Displays formatted report

Exit Codes

Code Description
0 Success
1 Failure

Notes

  • Read-only operation, no changes made
  • Reports all local users including disabled accounts
  • Shows group membership for each user
  • Displays active login sessions
  • Lists user profile folders with last use time

Example Output

[ LOCAL USER ACCOUNTS ]
--------------------------------------------------------------
Name            Enabled  LastLogon             PasswordSet
----            -------  ---------             -----------
Administrator   False    12/1/2025 9:00 AM     11/15/2025
limehawk        True     12/1/2025 10:30 AM    11/20/2025
DefaultAccount  False    <never>               <never>

[ ADMINISTRATORS GROUP ]
--------------------------------------------------------------
 [User] WORKSTATION\limehawk
 [Group] WORKSTATION\Administrators

[ USER GROUP MEMBERSHIPS ]
--------------------------------------------------------------

 limehawk:
   - Administrators
   - Users

[ ACTIVE LOGIN SESSIONS ]
--------------------------------------------------------------
 USERNAME       SESSIONNAME  ID  STATE   IDLE TIME  LOGON TIME
 limehawk       console      1   Active  none       12/1/2025 8:00 AM

[ USER PROFILES ON DISK ]
--------------------------------------------------------------
Profile Path                    Last Used            Loaded  Size(MB)
------------                    ---------            ------  --------
C:\Users\limehawk               12/1/2025 10:30 AM   True    15234
C:\Users\Administrator          11/15/2025 2:00 PM   False   1024

[ SUMMARY ]
--------------------------------------------------------------
 Total Local Users     : 3
 Enabled Users         : 1
 Disabled Users        : 2
 Administrator Members : 2
 User Profiles on Disk : 2

 Computer Name         : WORKSTATION
 Domain/Workgroup      : WORKGROUP

[ SCRIPT COMPLETED ]
--------------------------------------------------------------

Changelog

  • 2025-12-01 v1.0.0 Initial release
⚠️ **GitHub.com Fallback** ⚠️