Skip to main content
This guide helps you set up automatic local admin password rotation in Gorelo. The script creates a local admin account (if it doesn’t exist), assigns it to the local administrators group, sets a secure random password, and stores that password in Gorelo for easy retrieval.
1

Create the custom asset field.

  1. Navigate to Settings > Assets > Custom Fields.
  2. Add a custom field with the following details:
    • Name: Local Admin Password
    • Variable: localadminpassword
    • Type: Text
    • Toggle on Show on Asset Detail and Blue value.
  3. Click Save.
2

Create the script.

  1. Navigate to Scripts.
  2. Create a new script with the following details:
    • Name: 🔐 Set-LocalAdminPassword
    • Platform: Windows
    • Content: [Copy the PowerShell script provided below]
  3. Click Save.
3

Deploy the script via a policy.

  1. Navigate to Assets.
  2. Select any asset where the script has run.
  3. View the Custom Fields section to see the stored Local Admin Password.
  4. Click the reveal icon to display the password when needed.

Customize the script

The script includes several variables at the top that you can modify:
  • $localAdminAccount = “localadmin” # The username for the local admin account
  • $accountFullName = “Local Administrator” # The full name for the account
  • $accountDescription = "" # The account description (optional)
  • $hideFromLogonScreen = $true # Set to $false to show the account on logon screen
Adjust these variables to suit your organization’s needs before deploying the script.