Tried to set a password for the admin account and now I can't login! Help!

I tried to set a password for my admin account and now I cant log in “Bad username or password” How can I reset the code? I have access to files via vscode

Change the group for the admin role and add your user to it if your using active directory.

Navigate to C:\ProgramData\UniversalAutomation\Repository\.universal and open/edit the file called authentication.ps1

Edit it’s content to the default;

Set-PSUAuthenticationMethod -Type "Form" -ScriptBlock {

#   You can call whatever cmdlets you like to conduct authentication here.
#   Just make sure to return the $Result with the Success property set to $true

if ($Credential.UserName -eq 'Admin') {
    New-PSUAuthenticationResult -Success -UserName 'Admin'
else {
    New-PSUAuthenticationResult -ErrorMessage 'Bad username or password'

Restart the Universal.Server service and try to login with username Admin and whatever password (random strings/gibberish)

Does that allow you to log in again?

Also, please remember next time that even though we are all super ultra amazing people with unlimited knowledge - we cannot 100% correctly provide the perfect answers/instructions when we’re not given any information whatsoever about your setup/installation.

Do consider helping us, and thus yourself, by letting us know your type of installation whenever you seek help! <3

This did the trick! Thanks ALOT!

1 Like

True… I am very new til PU. Next time I will provide more info :smiley:

1 Like