I am trying to install a program from the network with elevated credentials. I am getting an error and am not having any luck finding a solution. Has anyone ran runnas and executed a network program? Does it need to be copied to the local pc and ran from there?


Map Error was execute: \\DC01\netlogon\sms\client.bat + 1 - Incorrect function.


 Code:
$network="@lserver\netlogon\programs\client.bat"
if @error<>0 'Map Error was server: '$network '+ ' + @ERROR + ' - ' + @SERROR ?    endif

$runaspath="@lserver\netlogon\runnas.exe"
if @error<>0 'Map Error was runaspath: ' $runaspath ' + ' + @ERROR + ' - ' + @SERROR ?    endif

shell $runaspath + ' user:domain\helpdesk' +' $network' + ' /pass:password'
if @error<>0 'Map Error was execute: ' + @ERROR + ' - ' + @SERROR ?    endif



Edited by tjcarst (2017-05-11 12:12 AM)
Edit Reason: Correct typo in title