We help IT Professionals succeed at work.

How to pause a startup script during a VPN event?

164 Views
Last Modified: 2019-03-21
Hi all, when I log onto my PC at work, my startup folder includes a PowerShell script. The script simply checks whether certain network drives are mapped; and if not, then map them. When I work from home, however, I have to VPN and manually authenticate before the network drives are revealed to me. I can add a time delay to my script, or wait for a manual key press.

I am thinking that the delay can be automated, possibly with a wait condition. Perhaps a ping to an IP address inside the firewall. If you have any suggestions to improve this, please let me know. One limitation, I do not have admin privileges on the PC.
Comment
Watch Question

JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
Can your VPN client run a script? That would be a good way to manage this. I use NCP Secure Entry and it can do that.
David VanZandtSr Software Engineer
CERTIFIED EXPERT

Author

Commented:
No, but thanks for the suggestion. :)
JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
Put in a WAIT for 15 seconds and that would accommodate the VPN connection.
Qlemo"Batchelor", Developer and EE Topic Advisor
CERTIFIED EXPERT
Top Expert 2015

Commented:
Pinging is something I do myself for this purpose. It 8s better than just waiting for a fixed time.
Sr Software Engineer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Qlemo"Batchelor", Developer and EE Topic Advisor
CERTIFIED EXPERT
Top Expert 2015

Commented:
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.