Execute-ProcessAsUser Issue

Is there a trick to getting Execute-ProcessAsUser to work?

I am on Windows 10. I am running the a PSADT deployment under the system account. I am logged on to the machine when the deployment is running. PSADT is version 3.6.8. The command I am running is: Execute-ProcessAsUser -Path “$dirfiles\scripts\AcroProCopyFile.exe” -RunLevel ‘HighestAvailable’ -Wait $true -ContinueOnError $true

The following is put in the log file:
[Installation] :: Create scheduled task to run the process [C:\WINDOWS.marimba\MarimbaEndpointTuner\ch.87\data\scripts\Files\scripts\AcroProCopyFile.exe] as the logged-on user [True]… Execute-ProcessAsUser 5/10/2017 9:08:36 AM 8068 (0x1F84)
[Installation] :: [C:\WINDOWS\System32\schtasks.exe] is a valid fully qualified path, continue. Execute-Process 5/10/2017 9:08:36 AM 8068 (0x1F84)
[Installation] :: Working Directory is [C:\WINDOWS\System32]. Execute-Process 5/10/2017 9:08:36 AM 8068 (0x1F84)
[Installation] :: Executing [C:\WINDOWS\System32\schtasks.exe /create /f /tn PSAppDeployToolkit-ExecuteAsUser /xml “C:\Users\Public\PSAppDeployToolkit\PSAppDeployToolkit-ExecuteAsUser.xml”]… Execute-Process 5/10/2017 9:08:36 AM 8068 (0x1F84)
[Installation] :: Standard error output from the process: ERROR: No mapping between account names and security IDs was done.(35,5):UserId: Execute-Process 5/10/2017 9:08:36 AM 8068 (0x1F84)
[Installation] :: Execution completed with exit code [1]. Execute-Process 5/10/2017 9:08:36 AM 8068 (0x1F84)
[Installation] :: Failed to create the scheduled task by importing the scheduled task XML file [C:\Users\Public\PSAppDeployToolkit\PSAppDeployToolkit-ExecuteAsUser.xml]. Execute-ProcessAsUser 5/10/2017 9:08:36 AM 8068 (0x1F84)

If I just run the script, not under the system account but with my account, the above will work.

Any thoughts on what is happening? Do I need version 3.6.9?

Hi,

Execute-ProcessAsUser is creating a Schedule task and make it run Under the user credential if someone is logged on. If noone islogged on then the Schedule task will run at logon.

I am getting the error has you are showing in your log. Question I have. I am RDP remote logon connection to the Windows 10 machine. Would this make the script appear local user is not logged on?

We got it to work. I do not remember what we changed. RDP should not make a difference, but PSADT is looking for the console user.