Unidesk Appliance Backup Utility scheduled task must be run as the same user who ran the tool

Unidesk Appliance Backup Utility scheduled task must be run as the same user who ran the tool

book

Article ID: CTX223715

calendar_today

Updated On:

Description

When you make a scheduled appliance backup task with the utility, the task must specify the same Run As user as the one you're logged in with when you run the tool. Otherwise, your encrypted passwords for vCenter and the MA will be unavailable. You will see errors like this in the Appliance Backup logs:

00-00-29-AM - Error Updating Status with Management Appliance - Received an unhandled exception of type System.Management.Automation.PSInvalidCastException. Cannot convert the "" value of type "System.String" to type "System.Management.Automation.PSCredential". 

At C:\downloads\backuputility\powershell\MCPBackup.ps1:1082 char:68
+ $passwordbackMA = Get-Content $CredFileMA | ConvertTo-SecureString <<<< 

Exception:
Key not valid for use in specified state.

At C:\downloads\backuputility\powershell\MCPBackup.ps1:1083 char:28
+ $credentialMA = New-Object <<<< System.Management.Automation.PsCredential("Administrator",$passwordbackMA)

Exception:
Exception calling ".ctor" with "2" argument(s): "Cannot process argument because the value of argument "password" is null. Change the value of argument "password" to a non-null value."

At C:\downloads\backuputility\powershell\MCPBackup.ps1:1084 char:127
+ $MyUDAdminPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR <<<< ($credentialMA.Password))

Exception:
Exception calling "SecureStringToBSTR" with "1" argument(s): "Value cannot be null.
Parameter name: s"

At C:\downloads\backuputility\powershell\MCPBackup.ps1:1086 char:147
+ $global:credMA = New-Object System.Management.Automation.PSCredential -argumentlist "Administrator", (ConvertTo-SecureString -AsPlainText -String <<<< $MAPW -Force)

Exception:
Cannot bind argument to parameter 'String' because it is an empty string.


And pretty much every function in the script will have failed with those or similar functions. To resolve this, login as the Run As user and re-run the tool, specifying and saving both passwords (VC and MA). Then the next scheduled run will be fine.

Testing a live backup (not a scheduled one) will not test this properly. You need to have this run as a scheduled task. But you can always change the schedule to run "in 2 minutes" rather than waiting for the next run at midnight.

 

Resolution

Unidesk Appliance Backup Utility scheduled task must be run as the same user who ran the configuration tool. Either change the Scheduled Task to run as the user who ran the configuration tool, or make sure you login as the user in the scheduled task.  If you think you need to respecify the password in the tool while logged in as the correct user, go through the entire Utility configuration page and respecify everything just in case it helps.

Problem Cause

Passwords are encrypted in Windows so that only the user that encrypted the password can decrypt it. The user account that runs the configuration tool encrypts the passwords for vCenter and communicating with the MA. In order for the script to decrypt those passwords and use them, it must be run as the same user.