Skip to main content

Create a Local Administrator Account on Windows

Description

Use this Fileset recipe to create a named local administrator account on managed Windows devices. The download includes separate PowerShell scripts for account creation and removal, with environment variables for the username, password, and full name.

Ingredients

Directions

  1. Download and unzip the Fileset

  2. Import the Fileset into your server with FileWave Central.
  3. Select the Fileset, then open its Scripts view.
  4. Select create_admin.ps1 to open the script propertiesCreateLocalAdminWindows1.png
  5. Enter in your local admin Username, Password and Full Name for the desired accountCreateLocalAdminWindows2.png
  6. Repeat the process for the remove_admin.ps1 and enter in the desired Username to remove

    Removal deletes local data. The USERNAME environment variable in remove_admin.ps1 must exactly match the account name. The included removal script deletes the local account and recursively deletes C:\Users\<Username> when that profile directory exists. Test with a disposable account and confirm that no required user data remains before deployment.

    CreateLocalAdminWindows3.png
  7. Close the Script window to Save
  8. Assign to a test device
  9. Perform a Model Update to deploy

To confirm account creation, open Windows Settings > Accounts > Other users and verify that the new local administrator appears.CreateLocalAdminWindows4.png

Notes

Both scripts will output their executed tasks for detailed logging. These logs may be found in:

C:\ProgramData\FileWave\Logs\

The create_admin script log will be labeled: CreateLocalUser_FromEnv.log

CreateLocalAdminWindows8.png

The remove_admin script log will be labeled: RemoveLocalUser_FullCleanup.log

CreateLocalAdminWindows6.png

The creation script skips the operation when an account with the specified username already exists; it does not replace or update that existing account.

CreateLocalAdminWindows5.png