I’m attempting to run a simple script with a stored credential. I’ve created the secret variable for my AD-based service account, domain\service with the password and set the script to run as this account. The script is set to run in the Windows PowerShell 5.1 environment. The service account is granted log on as a batch job, log on as a service, replace a process level token, and adjust memory quotas for a process. PSUniversal itself is running as Local System.
The script works fine if I log into the PSUniversal server as the service account and run it from the repository directly. All the script does is import the Posh-SSH module, test for the presence of a file to transfer and if it exists, open an SFTP session, upload the file, and close the SFTP session. However it looks like some or all commands are not imported correctly? The job output produces these errors:
Feb 1, 2022 6:26 PM [warning] Failed to verify module and server version. Call failed. An error occurred while sending the request. GET https://localhost:443/api/v1/version
Feb 1, 2022 6:26 PM Imported module Posh-SSH
Feb 1, 2022 6:26 PM [error] Access to the path ‘C:\Windows\system32\config\systemprofile’ is denied.
Feb 1, 2022 6:26 PM [error] Cannot bind argument to parameter ‘SessionId’ because it is null.
The import message is just the result of the module import being wrapped in a try/catch block, and the “Cannot bind” argument is the result of one of the Posh-SSH commands seemingly not functioning correctly.
Product: PowerShell Universal
Version: 2.5.5