How to pause a startup script during a VPN event?

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.
LVL 23
David VanZandtOracle Database Administrator IIIAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnBusiness Consultant (Owner)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 VanZandtOracle Database Administrator IIIAuthor Commented:
No, but thanks for the suggestion. :)
JohnBusiness Consultant (Owner)Commented:
Put in a WAIT for 15 seconds and that would accommodate the VPN connection.
Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Pinging is something I do myself for this purpose. It 8s better than just waiting for a fixed time.
David VanZandtOracle Database Administrator IIIAuthor Commented:
John mentioned using a script in the VPN connection, which led me to explore the wealth of alternatives at Cisco (see <>. In particular I turned to PowerShell, using the OnConnect cmdlet to execute a script that's triggered by a successful connection). I'll share the final solution if I get permission.  Thanks to both of you.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.