Skip to content

local_user_create.ps1

Corey Watson edited this page Dec 19, 2025 · 1 revision

local_user_create.ps1

Creates a new local user account with specified username and password.

Overview

This script creates a new local user account with specified username and password. Optionally adds the user to the Administrators group.

Purpose

Creates a new local user account with specified username and password. Optionally adds the user to the Administrators group.

Prerequisites

  • Windows 10/11
  • Admin privileges required
  • PowerShell 5.1+

Configuration

Data Sources & Priority

  1. Hardcoded values (username, password, admin flag)

Required Inputs

  • Username : Username for the new account
  • Password : Password for the account
  • AddToAdmin : "Yes" or "No" - whether to add to Administrators group

Settings

  • Creates standard local user account
  • Optional administrator privileges

Behavior

  1. Validates inputs
  2. Creates local user account
  3. Optionally adds to Administrators group
  4. Reports final status

Security Notes

  • Password visible in script - use RMM variables for production
  • No secrets logged to output

Exit Codes

  • 0: Success
  • 1: Failure

Example Output

[ INPUT VALIDATION ]
--------------------------------------------------------------
Username    : newuser
Add to Admin: No

[ OPERATION ]
--------------------------------------------------------------
Creating user account...
User created successfully

[ RESULT ]
--------------------------------------------------------------
Status : Success
User   : newuser
Admin  : No

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

Version History

  • 2025-11-29 v1.0.0 Initial Style A implementation

Links

Clone this wiki locally