KB0028 - Update the default admin password during startup.

KB0028 - Update the default admin password during startup.

Applicability

This article applies to users wishing to set the default admin password automatically on startup. 

Root Cause

PowerShell Universal creates an admin account during startup if it does not exist. It will set the default password to admin. Some users wish to change this password automatically during startup. 

Workaround

In order to accomplish this, you will need to create an authentication.ps1 file in the .universal folder. Even if you do not use a license, the script will be run. No authentication methods will be configured without a license but you can include this code in order to set your default admin password. Replace `MyPassword` with the password string you would like to use. 
  1. $IdentityService = $UniversalClient.GetType().GetProperty('_identityService', [System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic).GetValue($UniversalClient)
  2. $AdminIdentity = $IdentityService.GetOrCreateIdentity("Admin""Api")
  3. $AdminIdentity.Password = "MyPassword"
  4. $IdentityService.UpdateIdentity($AdminIdentity)

    • Related Articles

    • KB0069 - PowerShell Universal Startup Process

      Purpose The purpose of this document is to outline the steps that PowerShell Universal takes when starting up. Process 1. Insert current product version and install date in database Updates the database with a record about the current product version ...
    • IIS: HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure

      Applies to: PowerShell Universal 1.4 or later When configuring PowerShell Universal to run under IIS, you may be presented with an error that states ANCM Out-Of-Process Startup Failure. This error can be presented for a variety of reasons but the ...
    • KB0067 - Granting an app token with a username and password on the command line

      Scope This applies to users wishing to issue app tokens from the command line in PowerShell Universal using a username and password. Process Method 1 - Form Authentication You can use the PowerShell Universal form authentication endpoint to produce a ...
    • KB0021 - Unable to update Dashboard Pages in PowerShell Universal 3.6.4

      Purpose Due to an issue with the client-side application in PowerShell Universal 3.6.4, you may experience a problem updating page content. When clicking the Save button, a toast message would be shown that states that a 400 HTTP error had occurred. ...
    • KB0055 - Blank Admin Console or No Updates After Upgrade

      Affected Versions - PowerShell Universal 4.2.x Problem When navigating to subpages (such as /admin/automation/scripts) in the admin console, the page will display a blank page. Navigating directly to the /admin URL will load the page. Additionally, ...