Tuesday, November 14, 2017

Proxy refresh

Challenge:
Licensing requires Internet access - however, after some time of inactivity the port used to refresh the license file is closed. Opening Internet Explorer and loading the URI to the home page of the license provider also open the cloud connection.

Solution:
Automate opening the web page (URI) at regular intervals by means of a powerShell scipt

Content of script:
curl https://test.com -Proxy 'http://10.22.19.2:8080' -UseDefaultCredentials -UseBasicParsing

Invoke-WebRequest -Uri 'http://test.com' -Proxy 'http://10.22.19.23:8080' -ProxyUseDefaultCredentials -UseBasicParsing

Run command:
powershell.exe -file C:\scripts\proxy_refresh.ps1

Automation was accomplished using the free version of 'System Scheduler' from Splinterware.
https://www.splinterware.com/products/scheduler.html