Pages

Monday, July 31, 2017

Using Command Line explorer.exe Net to Re-establish Network Shares After VPN is Established Through a Captive Portal

As shown in Using Net Use to Re-establish Network Shares After VPN is Established Through a Captive Portal Net use can be easily used with Windows Task Scheduler to reconnect the shares after establishing a VPN connected over a captive portal. An alternative method is to create a .cmd file using explorer.exe to reconnect the shares and the Windows Management Instrumentation Command-line (WMIC) to find and terminate the explorer processes


Create a .cmd file similar to

start "RECONNECT_HOME_DRIVE" /MIN explorer.exe H:\
start "RECONNECT_SHARE_DRIVE" /MIN explorer.exe X:\

WMIC PROCESS WHERE "CommandLine like '%%explorer.exe /factory%%'" DELETE

Use the same process described in Using Net Use to Re-establish Network Shares After VPN is Established Through a Captive Portal to find and create the event trigger. The steps from the other post are included below.

Start the Windows Event Viewer and look for a useable event for the trigger. In my case, under Applications and Services logs I found an event logged upon successfully establishing the VPN. 

After finding a suitable event, right click on it and select Attach Task to This Event.

Give it a name and description. Select Next
When an Event is logged. No updates. Select Next
Define the action. Select Start a Program radio button. Select Next
Browse to the Program/Script (command file) created and provide any optional arguments. Select Next.
Review the event and trigger and select Finish.

Now, log off and log back in. If all is correct then upon successfully establishing the VPN the script will be triggered and the shares will be reconnected.


Tuesday, July 25, 2017

Using Net Use to Re-establish Network Shares After VPN is Established Through a Captive Portal

When on a customer site or traveling for work, you will probably encounter a captive portal at some point. In my case, my Outlook personal folders and home directory are on corporate share drives and I need to re-establish the connectivity to the share before starting Outlook. Due to the captive portal, the VPN connection cannot be established after logging in so Windows never re-establishes the connections to the shares.

An easy way to automate the re-connection of the shares is to locate an event, ideally a VPN or network event, to use as a Task Scheduler Trigger.

Create a .cmd file using the following template save it.


@echo off
net use x: \\computername\sharename /persistent:yes
net use h: \\computername\sharename /persistent:yes

Start the Windows Event Viewer and look for a useable event for the trigger. In my case, under Applications and Services logs I found an event logged upon successfully establishing the VPN connection. 

After finding a suitable event, right click on it and select Attach Task to This Event.

Give it a name and description. Select Next
When an Event is logged. No updates. Select Next
Define the action. Select Start a Program radio button. Select Next
Browse to the Program/Script (command file) created and provide any optional arguments. Select Next.
Review the event and trigger and select Finish.


Now, log off and log back in. If all is correct then upon successfully establishing the VPN the script will be triggered and the shares will be reconnected.

Thursday, July 6, 2017

NoMagic's Cameo Enterprise Architecture - Sizing Windows 2012R2 Server for Remote Desktop Services

To facilitate a rapid deployment of NoMagic's Cameo Enterprise Architecture (Magic Draw), the thick client products can be run on Windows 2012r2 servers running as application servers. Additional Remote Desktop Services (RDS) Client Access Licenses (CALs) will allow the application server(s) to provide for simultaneous use of the products. This white paper identifies the memory and core (CPU) sizing for the RDS servers to satisfy the user requirements for using these products on application servers.

For details, obtain the whitepaper here.