Page 1 of 1

Run powershell as different user

Posted: Wed Oct 01, 2014 11:44 am
by nmc_tme
I need to run a powershell script as a specific ldap user. The powershell script is executed from within the project:
Code: Select all
<project name="HR Import" mainModule="Main" version="2.0">
	<module name="Main">
		<exec label="Execute Powershell Script with Parameters" executable="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" workingDir="C:\Windows\System32\WindowsPowerShell\v1.0" inputFile="C:\Linoma_Scripts\HR_Import\empty.txt" version="1.0" logLevel="debug">
			<arg value="-File" />
			<arg value="C:\Linoma_Scripts\HR_Import\HR_Import.ps1" />
			<arg value="-ExecutionPolicy" />
			<arg value="Bypass" />
		</exec>
	</module>
	<description>Execute a PowerShell script to import information</description>
</project>

The script appears to be currently executed as the machine account. is there any way to change this to another user account?

Re: Run powershell as different user

Posted: Wed Oct 01, 2014 11:52 am
by Support_Rick
GoAnywhere will automatically use the UserID used to start the GoAnywhere Service as the user running the local command.

I would suggest that you change the GoAnywhere Service under the Logon Tab and have GoAnywhere started by a Service Domain Account that has the permissions you need to execute the powershell script.

Remember, that Domain Account must have permissions to start GoAnywhere as a service and run the program as well.