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?