<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Install OpenVPN using Group Policy]]></title><description><![CDATA[<p dir="auto">Hi<br />
I have openvpn setup in pfsens, i want to deploy it to some 50 plus users machines. they do not have admin rights and are in domain.</p>
<p dir="auto">Is it possible to install it using group policy ?<br />
Really appreciate if someone can share some doc related to it.</p>
<p dir="auto">Regards</p>
]]></description><link>https://forum.netgate.com/topic/190541/install-openvpn-using-group-policy</link><generator>RSS for Node</generator><lastBuildDate>Wed, 13 May 2026 12:59:45 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/190541.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Oct 2024 17:38:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Install OpenVPN using Group Policy on Wed, 16 Oct 2024 20:49:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/snailkhan">@<bdi>Snailkhan</bdi></a> Sure.  Just grab the .msi installer and deploy it with GPO, or like I do with a Powershell script that calls msiexec /qn</p>
<pre><code>$StartTime = Get-Date

#############################################################################################
## Variables
#############################################################################################

$PackageName = "OpenVPN Connect"
[version]$CurrentVersion = "3.5.0"
$InstallerFileName = "openvpn-connect-3.5.0.3818_signed.msi"

$MSIPackage = "$PSScriptRoot\$InstallerFileName"

$LogDir = "C:\Admin\Logs"
$MyDate = Get-Date -Format "MM-dd-yyyy_HHmm"
$LogName = $PackageName + "_Install_" + $MyDate + ".txt"
$UpdateLogName = $PackageName + "_Update_" + $MyDate + ".txt"

$Log = "$LogDir\$LogName"

#############################################################################################
## Function to get software version - just pass it the package name found in registry
#############################################################################################
function Get-InstalledSoftwareVersion
{
	Param (
	[Parameter(Position=0, Mandatory=$true)]
		[string]$PackageName
	)
		
	$InstalledSoftware = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
												'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' |
						Where-Object {$_.DisplayName -ne $null} | Select-Object DisplayName,Displayversion | Sort-Object -Property DisplayName
					
	[version]$PackageInstalledVersion = ($InstalledSoftware | Where-Object {$_.DisplayName -eq "$PackageName"}).DisplayVersion
	return $PackageInstalledVersion
}


#############################################################################################
## Function to install MSI base package
#############################################################################################


function Install-MSIPackage 
{
	$MSIArguments = @(
		"/i `"$MSIPackage`""
		"/qn"
		"/L*V `"$Log`""
		)

	Write-Host "Starting msiexec installation."
	Write-Host "Start-Process msiexec -ArgumentList $MSIArguments -Wait"
	
	Start-Process msiexec -ArgumentList $MSIArguments -Wait		
}

#############################################################################################
## Main
#############################################################################################

#Check if agent is installed and current
Write-Host "Checking if $PackageName is installed."
[version]$PackageInstalledVersion = Get-InstalledSoftwareVersion -PackageName $PackageName

if ($PackageInstalledVersion -eq $null){
	Write-Host "$PackageName not found. Running installer." -ForeGroundColor Yellow
	Install-MSIPackage
} elseif ($PackageInstalledVersion -lt $CurrentVersion) {
	Write-Host "$PackageName $PackageInstalledVersion found but is out of date. Current version is $CurrentVersion"
	Write-Host "Running installer."
	Install-MSIPackage
} else {
	Write-Host "Package is up to date, checked against version:$CurrentVersion" -ForegroundColor Green
}


$EndTime = Get-Date
$RunTime = $EndTime - $StartTime
Write-Host "Script run time:"
$RunTime | Select Hours,Minutes,Seconds,Milliseconds


</code></pre>
]]></description><link>https://forum.netgate.com/post/1188280</link><guid isPermaLink="true">https://forum.netgate.com/post/1188280</guid><dc:creator><![CDATA[dlogan]]></dc:creator><pubDate>Wed, 16 Oct 2024 20:49:42 GMT</pubDate></item></channel></rss>