<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mukul Dharwadkar</title>
    <description>The latest articles on Forem by Mukul Dharwadkar (@mukul_d).</description>
    <link>https://forem.com/mukul_d</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1451604%2F2adb7b58-f5c5-4982-ad88-6037c83f42dc.jpg</url>
      <title>Forem: Mukul Dharwadkar</title>
      <link>https://forem.com/mukul_d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mukul_d"/>
    <language>en</language>
    <item>
      <title>Automatic VPN Connectivity for Entra ID-Only Windows Devices: A Native Approach</title>
      <dc:creator>Mukul Dharwadkar</dc:creator>
      <pubDate>Mon, 28 Apr 2025 22:08:32 +0000</pubDate>
      <link>https://forem.com/mukul_d/manipulating-image-position-using-cssddd-4kb9</link>
      <guid>https://forem.com/mukul_d/manipulating-image-position-using-cssddd-4kb9</guid>
      <description>&lt;h2&gt;
  
  
  Executive Summary
&lt;/h2&gt;

&lt;p&gt;As enterprises shift towards cloud-first models, traditional on-premises VPN solutions like Always-On VPN Device Tunnels are no longer compatible with Entra ID-only (formerly Azure AD-only) Windows devices. &lt;/p&gt;

&lt;p&gt;This post presents a simple, robust framework using built-in Windows features — &lt;strong&gt;PowerShell&lt;/strong&gt;, &lt;strong&gt;VBScript&lt;/strong&gt;, and &lt;strong&gt;Task Scheduler&lt;/strong&gt; — to automate and ensure reliable VPN connectivity without third-party software.&lt;/p&gt;




&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;Modern IT emphasizes mobility, zero-trust architectures, and identity-driven access. Entra ID-only joined devices support this model by eliminating traditional domain dependencies.&lt;/p&gt;

&lt;p&gt;However, VPN connectivity has lagged behind. Microsoft's Always-On VPN Device Tunnel requires domain-joined devices, making it unsuitable for Entra ID-only setups.&lt;/p&gt;

&lt;p&gt;Organizations need a flexible, lightweight alternative that fits cloud-native deployments.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Without automatic VPN tunnels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Users must manually start VPN connections.&lt;/li&gt;
&lt;li&gt;Access to internal resources is inconsistent.&lt;/li&gt;
&lt;li&gt;IT support tickets increase.&lt;/li&gt;
&lt;li&gt;Security risks grow due to dependency on user actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The goal:&lt;/strong&gt;  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Seamless, persistent VPN connectivity using only native Windows tools.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  My Native Solution
&lt;/h2&gt;

&lt;p&gt;This lightweight solution uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;Batch Script&lt;/strong&gt; to install components.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;PowerShell Script&lt;/strong&gt; to start and monitor VPN.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;VBScript Wrapper&lt;/strong&gt; to run PowerShell invisibly.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;Task Scheduler Job&lt;/strong&gt; to automate at startup and login.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Components Breakdown
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Installation Batch Script&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creates a hidden folder &lt;code&gt;C:\Scripts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Copies operational scripts.&lt;/li&gt;
&lt;li&gt;Triggers task creation using PowerShell.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. PowerShell VPN Script&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checks VPN connection status.&lt;/li&gt;
&lt;li&gt;Starts VPN if not connected.&lt;/li&gt;
&lt;li&gt;Monitors and retries using an exponential backoff.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. VBScript Wrapper&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Launches PowerShell script silently.&lt;/li&gt;
&lt;li&gt;No flashing command windows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Task Scheduler Setup&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Launches the VBScript on system startup and login.&lt;/li&gt;
&lt;li&gt;Runs under SYSTEM privileges for resilience.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Technical Workflow
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyaavlrxcdmb2slzen56y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyaavlrxcdmb2slzen56y.png" alt="Image description" width="689" height="676"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Device boots.&lt;/li&gt;
&lt;li&gt;Task Scheduler triggers VBScript.&lt;/li&gt;
&lt;li&gt;VBScript runs PowerShell invisibly.&lt;/li&gt;
&lt;li&gt;PowerShell checks VPN status:

&lt;ul&gt;
&lt;li&gt;If connected, exit.&lt;/li&gt;
&lt;li&gt;If not connected, attempt connection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Monitor until connected.&lt;/li&gt;
&lt;li&gt;Log results to Event Viewer.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  How to Deploy
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Package the &lt;code&gt;.bat&lt;/code&gt;, &lt;code&gt;.ps1&lt;/code&gt;, &lt;code&gt;.vbs&lt;/code&gt; scripts together.&lt;/li&gt;
&lt;li&gt;Run the batch file as an &lt;strong&gt;administrator&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Verify that the scheduled task is created.&lt;/li&gt;
&lt;li&gt;Reboot and test VPN auto-connectivity.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  This can also be deployed through Intune which is what I have done. Reach out if you need help or guidance.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Security Considerations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tasks run as &lt;strong&gt;SYSTEM&lt;/strong&gt; — no user credentials exposed.&lt;/li&gt;
&lt;li&gt;Scripts are hidden in system folders.&lt;/li&gt;
&lt;li&gt;Future enhancements could include &lt;strong&gt;script signing&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Business Benefits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reduced IT workload:&lt;/strong&gt; VPN management becomes hands-off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better user experience:&lt;/strong&gt; No manual connection steps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supports cloud-first initiatives:&lt;/strong&gt; No legacy dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved security:&lt;/strong&gt; Consistent access control.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Future Enhancements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Package VPN management as a &lt;strong&gt;Windows Service&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Expand support for &lt;strong&gt;macOS&lt;/strong&gt; and &lt;strong&gt;Linux&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Collaborate with Microsoft for Entra ID device tunnel support.&lt;/li&gt;
&lt;li&gt;Add modern authentication integration (e.g., Azure MFA).&lt;/li&gt;
&lt;li&gt;Build user-facing tray apps for VPN status visibility.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;VPN connectivity for Entra ID-only devices should be &lt;strong&gt;automatic, reliable, and invisible&lt;/strong&gt; to users.&lt;/p&gt;

&lt;p&gt;By leveraging native Windows scripting and scheduling tools, organizations can bridge today's VPN gap without sacrificing their cloud-first strategy.&lt;/p&gt;

&lt;p&gt;This lightweight framework is the first step towards a future of &lt;strong&gt;OS-agnostic, automated VPN management&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Script List:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;installVPNAutomation.bat&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;startAndCheckVPN.ps1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;startAndCheckVPN.vbs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;startAndCheckVPNTasks.ps1&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-start-page" rel="noopener noreferrer"&gt;Task Scheduler Security Context&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-event-logs" rel="noopener noreferrer"&gt;PowerShell Event Logging&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/active-directory/devices/azuread-joined-devices-overview" rel="noopener noreferrer"&gt;Entra ID-Only Device Join Overview&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; Mukul Dharwadkar&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Copyright:&lt;/strong&gt; JnanaTech Ventures (2025)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;No unauthorized copying or distribution permitted.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>alwaysonvpn</category>
      <category>entraid</category>
      <category>cybersecurity</category>
      <category>vpn</category>
    </item>
    <item>
      <title>Manipulating image position using CSS</title>
      <dc:creator>Mukul Dharwadkar</dc:creator>
      <pubDate>Tue, 01 Oct 2024 22:14:00 +0000</pubDate>
      <link>https://forem.com/mukul_d/manipulating-image-position-using-css-1obd</link>
      <guid>https://forem.com/mukul_d/manipulating-image-position-using-css-1obd</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Centering an image alongside text in a container might seem straightforward, but dealing with the differences between block and inline elements often complicates the task. While it's easy to position these elements separately, combining them can present unexpected challenges. I recently encountered this issue when trying to align an image to the left and center the heading within the same container. After experimenting with outdated techniques like float, I turned to modern CSS tools like Flexbox to find a cleaner, more efficient solution. This article explores my approach and the lessons learned along the way.&lt;/p&gt;

&lt;h3&gt;
  
  
  The challenge
&lt;/h3&gt;

&lt;p&gt;The text I was using was my &lt;a href="https://www.dharwadkar.com/NewSite" rel="noopener noreferrer"&gt;site&lt;/a&gt; heading with the HTML element &lt;code&gt;&amp;lt;h1.&lt;/code&gt; which is a block-level element, which means that it doesn't play nice with other elements on the same line. It starts on a new line and needs to take up the entire line. Whereas the &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; element is an inline element which means it is happy to play with others on the same line. Of course, I could play with the CSS &lt;code&gt;float&lt;/code&gt; property, but there is a problem. The moment I introduce &lt;code&gt;float&lt;/code&gt; for an element, it takes that element out of the document flow. and it becomes hard to control the behavior of that element.&lt;/p&gt;

&lt;h3&gt;
  
  
  Options
&lt;/h3&gt;

&lt;p&gt;As mentioned earlier, I tried using &lt;code&gt;float: left&lt;/code&gt; and &lt;code&gt;float: inline-start&lt;/code&gt;, but it doesn't always behave as I want. As a best practice, I try to use the latest techniques as much as possible and that's where the modern &lt;code&gt;flex&lt;/code&gt; and CSS GridBox came in. &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex" rel="noopener noreferrer"&gt;Flexbox&lt;/a&gt; when assigned to the parent container, &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-content" rel="noopener noreferrer"&gt;aligns&lt;/a&gt; all the content text to the left as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fak6qwlnv2oa77lx4lbby.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fak6qwlnv2oa77lx4lbby.png" alt="Initial result with just flex"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a lot of trial and error, it came down to using specificity and going minimalist. I also wanted to have the option to style images that I might use on the site independently so I didn't apply any styling to the core &lt;code&gt;img&lt;/code&gt; element. I created several classes to manipulate the images and applied those. During all this trial and error, another problem vexed me. I couldn't get the image to align to the middle of the parent container with all the techniques I knew. I researched and tried with &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-self" rel="noopener noreferrer"&gt;&lt;code&gt;align-self&lt;/code&gt;&lt;/a&gt; property. That finally worked. I didn't want to apply this to the core &lt;code&gt;img&lt;/code&gt; element and I didn't want to create a class for this so I used the &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Combinators#child_combinator" rel="noopener noreferrer"&gt;Child Combinator&lt;/a&gt; to target the specific &lt;code&gt;img&lt;/code&gt; element which is a child of &lt;code&gt;header&lt;/code&gt; element (&lt;code&gt;header &amp;gt; img&lt;/code&gt;). That took care of the issue of image alignment.&lt;/p&gt;

&lt;p&gt;The next issue was to align the header text in the center. I tried all the tricks I knew with &lt;code&gt;text-align&lt;/code&gt;, &lt;code&gt;align-self&lt;/code&gt;, &lt;code&gt;align-items&lt;/code&gt;, &lt;code&gt;justify-self&lt;/code&gt;, and &lt;code&gt;justify-items&lt;/code&gt;. But because the parent &lt;code&gt;header&lt;/code&gt; element was marked as &lt;code&gt;flex&lt;/code&gt;, the subsequent styles didn't apply. Finally I tried a simple trick to center the content using &lt;code&gt;margin: auto&lt;/code&gt; and that did the trick. Here's how the final output looks now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2uy69gsaomgbfry98by0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2uy69gsaomgbfry98by0.png" alt="Final result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even when I change the height of the header container, the image and text are vertically in the middle of the element and stay where there on the x-axis.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final code
&lt;/h3&gt;

&lt;p&gt;HTML code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;header class="flexi"&amp;gt;
  &amp;lt;img class="round-img small" src="img/Mukul-2019.jpg" alt="Mukul Dharwadkar" caption="Picture of Mukul Dharwadkar" /&amp;gt;
  &amp;lt;h1 class="center-align"&amp;gt;
    Mukul Dharwadkar
  &amp;lt;/h1&amp;gt;
&amp;lt;/header&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CSS code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;header {
    width: 900px;
    margin: auto;
    height: 120px;
    background-color: antiquewhite;
  }

/* The CSS rule below is highly specific for an img element that is a child of the header element.
Typically there will be only one img element inside the header and therefore this is safe to keep */

header &amp;gt; img {
  align-self: center;
}

.flexi {
  display: flex;
}

.round-img {
  border-radius: 50%;
}

.small {
  width: 100px;
}

.flexi {
  display: flex;
}

.center-align {
  margin: auto;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The full code is on my &lt;a href="https://github.com/mukuld/NewSite.git" rel="noopener noreferrer"&gt;Github&lt;/a&gt; repo. Feel free to use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;Achieving the perfect alignment of images and text in web design often requires experimenting with different CSS techniques. In this case, Flexbox proved to be the most efficient and modern solution for centering content within a container, while maintaining the flexibility to adjust styling independently. By using targeted selectors like the Child Combinator and leveraging Flexbox’s alignment properties, I was able to solve the issue cleanly and efficiently. This method not only streamlines the code but also ensures that future adjustments will be easier to manage. CSS can be tricky, but with the right approach, you can create polished, professional layouts.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>html</category>
    </item>
  </channel>
</rss>
