Create the custom asset field
- Navigate to Settings → Assets → Custom Fields
- 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’
- Click Save
Create the script
- Navigate to Scripts
- Create a new script with the following details:
- Name: 🔐 Set-LocalAdminPassword
- Platform: Windows
- Content: [Copy the PowerShell script provided below]
- Click Save
Deploy the script via a policy
- Navigate to Assets
- Select any asset where the script has run
- View the Custom Fields section to see the stored Local Admin Password
- 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