Powershell Embedded Skript - does not work [RDM 2020.2.20.0 64-bit]
Hi there,
i'm trying to execute an embedded skript under a different user out of RDM.
But it seems that the script could not be written to the temp folder. Testet this on 2 different clients with the same version. I've got on both the following (cut) error message:
ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang.
In Zeile:4 Zeichen:3
+ & "C:\Users\user\AppData\Local\Temp\RDM\a74b570f-7873-43c6-80a8-a7d8 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\user\...7d89848900d.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager>Translated it means sth. that the file could not be detected as executable program.
If I look to the Folder I see that for every run it creates the script there, so that could not ne problem:
Do you have an idea whats the problem here ?
The User which should run the script has aswell permissions to this temporary folder of the user in which the temp scripts getting created.
Kind regards,
Constantin
Environment:
Caption : Microsoft Windows 10 Pro
Version : 10.0.19041
BootDevice : \Device\HarddiskVolume2
BuildNumber : 19041
BuildType : Multiprocessor Free
CodeSet : 1252
CountryCode : 49
PS N:\> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.19041.546
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.546
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1Hello Constantin,
I was not able to replicate the error.
After you receive the error, could you execute whoami to see which user is logged in. If it is the one that you configured with the credentials, could you try to run the ps1 file and see if it executes or if you get the same error.
Best regards,
Richard Boisvert
Hi Richard,
i can replicate that if I try to get there with usual runas commands. So it seems to be a kind of UAC issue I guess, even if it's disabled on that machine.
>runas /user:domain\admin powershell
cd C:\Users\user\AppData\Local\Temp\RDM
I will check that this week. But from another perspective its maybe not the best way to store the files in the users temp directory, because that requires in every way that the runas user has lokal admin permissions to access the file in the other's users directory.
Kind regards,
Constantin
Hello Constantin,
Has a test, could you run RDM as a portable version: https://help.remotedesktopmanager.com/installation_portableusb.html and try to run an embedded script with another user.
We just want to validate that the temporary location of the script is not causing the issue.
Best regards,
Richard Boisvert
Hi Richard,
i could solve the issue by configuring the uac a bit different. In detail setting the value EnableLUA under "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" from 1 to 0. (To Complete disable the uac)
After that the Run-As works in RDM as designed :-) [Same behaviour in the portable version]
Thanks for your help,
Kind regards,
Constantin
Hello Constantin,
Glad it is now working, thank you for sharing your solution.
Have a great day,
Richard Boisvert