Invoke-Webrequest SSIS and Not logged-in to host

Peter Phillips 1 Reputation point
2021-04-15T10:03:28.16+00:00

I've got an PS script using invoke-webrequest to obtain data from an API.
The plan is to run the script as an SSIS package and scheduled using SQL agent using a proxy credential (currently using my account).

This is all working under one scenario - I must be logged onto the server via RDP. Under that condition, it all works fine.
However, when I log off from the server and run the agent job - everything appears fine, but the invoke-webrequest doesn't retrieve any data. (I have tried outputting the command using out-file, and i get back a blank file)

I think it's specifically to how the host server handles the invoke-webrequest when the account used isn't interactive - so...has anyone else encountered this and figured how to get it to work while the account isn't logged on?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,706 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,452 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,363 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Monalv-MSFT 5,891 Reputation points
    2021-04-23T09:53:56.19+00:00

    Hi @Peter Phillips ,

    May I know if you can paste your solution in the answer and accept your own answer?

    Best regards,
    Mona

    0 comments No comments