# How to run powershell script as admin in ssis

**URL:** https://forums.powershell.org/t/how-to-run-powershell-script-as-admin-in-ssis/10800
**Category:** PowerShell Help
**Created:** [June 11, 2018, 9:54am UTC](https://forums.powershell.org/t/how-to-run-powershell-script-as-admin-in-ssis/10800 "2018-06-11T09:54:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dtomar](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@dtomar](https://forums.powershell.org/u/dtomar)
#### Post date: [June 11, 2018, 9:54am UTC](https://forums.powershell.org/t/how-to-run-powershell-script-as-admin-in-ssis/10800/1 "2018-06-11T09:54:02Z")

</div>

Hi, I am trying to run powershell script in SSIS package, but its failing to run the script. The scripts runs fine when run as administrator on powershell but fails when run on cmd or in ssis.

```
Executable :-- C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
```

When I change “-file” to “command” ssis package runs but does’t get the right data from api . I have checked it with various execution policy and I can’t change server settings.

```
Arguments :-- -NoProfile -ExecutionPolicy Bypass -file C:\Users\random.ps1 -oauth_consumer_key “random” -oauth_consumer_secret “random” -oauth_token “random” -oauth_token_secret “random” -url “random” -location “random”.json
```

---

<div class="post-metadata">

### Author: ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)
#### Post date: [June 11, 2018, 11:52am UTC](https://forums.powershell.org/t/how-to-run-powershell-script-as-admin-in-ssis/10800/2 "2018-06-11T11:52:22Z")

</div>

It probably isn’t execution policy; you probably need to configure SSIS to run the command under different credentials. Alternately, you might not be passing the right parameters, but not knowing anything about the API I can’t really begin to guess. If it works when you run it from the console, then you’re probably not having a PowerShell problem - it’s much more likely something in the way SSIS needs to work, but I can’t help there.

---

<div class="post-metadata">

### Author: ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)
#### Post date: [May 16, 2024, 8:34pm UTC](https://forums.powershell.org/t/how-to-run-powershell-script-as-admin-in-ssis/10800/3 "2024-05-16T20:34:58Z")

</div>


