# Running a powerscript as another user from Remote computer

**URL:** <https://www.finalbuilder.com/forums/t/running-a-powerscript-as-another-user-from-remote-computer/5562>\
**Category:** Discussion\
**Created:** [May 5, 2017, 10:17am UTC](https://www.finalbuilder.com/forums/t/running-a-powerscript-as-another-user-from-remote-computer/5562 "2017-05-05T10:17:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohitvashistha](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/7ba0ec/32.png) [@mohitvashistha](https://www.finalbuilder.com/forums/u/mohitvashistha)\
**Post date:** [May 5, 2017, 10:17am UTC](https://www.finalbuilder.com/forums/t/running-a-powerscript-as-another-user-from-remote-computer/5562/1 "2017-05-05T10:17:37Z")

</div>

I am trying to run a powershell script from a computer (name: Builds) on a remote computer (name: Test), both machine are running Windows 10. The script is as follows:

```

01.param ([Parameter(Mandatory=$true)][string]$buildPath)

02. 

03.$strScriptUser = "Test"

04.$strPass = "hld@1234"

05.$PSS = ConvertTo-SecureString $strPass -AsPlainText -Force

06.$Credential = new-object system.management.automation.PSCredential $strScriptUser,$PSS

07. 

08.Write $Credential.UserName

09. 

10.Start-Process powershell.exe "C:\Users\Test\Documents\PowerShellForContinua\Core.ps1 '$buildPath'" -Credential $Credential -Wait

```

When I run the above script on Test computer, locally it works fine. But when I try to execute this script from Builds computer it giving following error:  
 ![](https://www.finalbuilder.com/forums/uploads/default/original/2X/0/09c76e0ef0557b44aaa7514488c2447d931fb186.png)  
  
Although username and password are correct. Only things is that password contains special character. This is how I am calling the script  
  
 ![](https://www.finalbuilder.com/forums/uploads/default/original/2X/d/d0904e96810efa28150a7d3808e5d4154ec56964.png)

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [May 8, 2017, 2:32am UTC](https://www.finalbuilder.com/forums/t/running-a-powerscript-as-another-user-from-remote-computer/5562/2 "2017-05-08T02:32:32Z")

</div>

Hi,  
  
Does the user account exist locally on the Continua CI agent machine? Can you try running the script directly in a command prompt on the agent machine?
