Closed RefleCs closed 3 years ago
Hi RefleCs,
I have/had the same issue and for that I use a randomdelay of one minute in the script. When opened with PowerShell ISE:
Line 260 $delay = New-TimeSpan -Minutes 1 Line 261 $trigger = New-ScheduledTaskTrigger -AtLogOn -RandomDelay $delay
I would prefer a not random delay but I can't find the proper powershell command to do that.
Hope this helps.
Regards,
DJITS.
Hi guys please see the wiki for a VPN based trigger. This allows to run the task after establishing a VPN connection https://github.com/nicolonsky/IntuneDriveMapping/wiki/Trigger-Script-on-VPN-Connection
When using an Always on VPN the script allready ran before the connection is set-up. I would love to see a check somewhere where it waits for the server to be available before running the script any further.
If there is no connection yet the script wil break with a warning:
WARNING: Exception calling "FindOne" with "0" argument(s): "The server is not operational.