How to run powershell script as admin in ssis

Welcome Forums General PowerShell Q&A How to run powershell script as admin in ssis

This topic contains 1 reply, has 2 voices, and was last updated by

1 year ago.

  • Author
  • #102250

    Topics: 2
    Replies: 2
    Points: 0
    Rank: Member

    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 
  • #102278

    Topics: 13
    Replies: 4872
    Points: 1,813
    Helping HandTeam Member
    Rank: Community Hero

    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.

The topic ‘How to run powershell script as admin in ssis’ is closed to new replies.