Is there a way to turn PIA off on a timer
Hello
I've currently got it set in task scheduler to shut PIA off at a certain time and start it again later, When It's shut down though it maintains the connection and the VPN is still active.
Is there anyway to work around that and get it to shut down without me having to manually turn it off ?
I'm on version 1.3.3
Any help would be appreciated
Thanks
I've currently got it set in task scheduler to shut PIA off at a certain time and start it again later, When It's shut down though it maintains the connection and the VPN is still active.
Is there anyway to work around that and get it to shut down without me having to manually turn it off ?
I'm on version 1.3.3
Any help would be appreciated
Thanks
Comments
I am not aware of any feature which would allow for timed use. It may be possible to write a script that could perform this, but we would be unable to assist with this scenario.
process is still hanging around in the task list? I mentioned this above. Or were you trying to disconnect/kill the pia-openvpn process because if that's all you did it will reconnect if the pia-service process is still running.pia-openvpnThank you very much for the advice man, I'll give that a go with the information you provided and post back here with updates
Thanks again
$tapindex = (Get-NetAdapter | ? Virtual -eq $true | ? Status -eq 'Up' | ? DriverName -match 'tap-pia-*').ifIndex;$piaservicepid = (Get-Process 'pia-service').Id;
Get-NetAdapter | ? ifIndex -eq $tapindex | Disable-NetAdapter -Confirm:$false;
Stop-Process -Id $piaservicepid -PassThru -Force;
Get-NetAdapter | ? ifIndex -eq $tapindex | Enable-NetAdapter -Confirm:$false
Sorry for the delay In replying.
I've managed to get it working by setting Task Scheduler to run the first script you provided, It wouldn't run it by default though and after some fiddling about I found that I had to set the Task to run with highest privileges.
So currently I've got three tasks scheduled, Two for opening and closing PIA and the other for running the script bellow
Get-Process 'pia-service' -ErrorAction SilentlyContinue | Stop-Process -PassThru -Force
I've set one of the tasks to close PIA just after the script above is ran so it doesn't maintain the connection once the app is closed.
I've also set PIA to reconnect on app launch so I just use Task Scheduler to open it on a timer
Thanks you very much for your help, It would of taken me weeks to try and figure all this out by myself.