Skip to main content
daradona10
New Member
October 18, 2024
Question

FortiClient VPN Config profile fails to import via Intune

  • October 18, 2024
  • 4 replies
  • 4318 views

Hello Everyone

 

I have set up FortiClient VPN via Intune to deploy to company portal for our users in the company to grab but I want to have the pre existing config to be set up but no matter what way I set it up via script as no errors are showing, I am stumped. I have tried everything. Any help would be greatly appreciated as to where I might be going wrong or need to adjust?

My config in xml. I have left blank in the spaces 

FortiClientConfiguration>

    <VPN>

        <Connection>

            <Name></Name>

            <Server></Server>

            <Port></Port>

            <Username></Username>

            <Password></Password>

                  <sso_enabled>1</sso_enabled>

        </Connection>

    </VPN>

</FortiClientConfiguration>

 

This is my install powershell script which works installing it but doesnt pull the config above with it

 

# Install FortiClient
$installExitCode = (Start-Process "msiexec.exe" -ArgumentList "/i FortiClient.msi /passive /quiet INSTALLLEVEL=3 DESKTOPSHORTCUT=0 /NORESTART" -NoNewWindow -Wait -PassThru).ExitCode
if ($installExitCode -ne 0) {
Write-Error "Installation failed with exit code $installExitCode"
exit $installExitCode
}

# Pause for 15 seconds
Start-Sleep 15

# Verify configuration file exists
$configFilePath = "C:\HMVVPN.conf"
if (-Not (Test-Path $configFilePath)) {
Write-Error "Configuration file not found: $configFilePath"
exit 1
}

# Import VPN configuration
$importProcess = Start-Process "C:\Program Files\Fortinet\FortiClient\FCConfig.exe" -ArgumentList "-m all -f $configFilePath -o import -i 1 -p YourPassword" -Wait -PassThru
$importExitCode = $importProcess.ExitCode
if ($importExitCode -ne 0) {
Write-Error "Configuration import failed with exit code $importExitCode"
exit $importExitCode
} else {
Write-Output "Configuration import successful."
}


ANY IDEA AS TO WHY IT ISNT PULLING THE CONFIG IN? 

4 replies

Anthony_E
Staff
Staff
October 21, 2024

Hello,


Thank you for using the Community Forum. I will seek to get you an answer or help. We will reply to this thread with an update as soon as possible.


Thanks,

Best Regards
daradona10
New Member
October 21, 2024

Thank You

funkylicious
SuperUser
SuperUser
October 21, 2024

Hi,

Maybe try, FCConfig -m vpn -f <filename> -o importvpn -i 1 -p <encrypted password> or FCConfig -m vpn -f <filename> -o importvpn -i 1, if not password protected.

 

L.E. https://community.fortinet.com/t5/Support-Forum/Forticlient-free-enterprise-distribution-SCCM/m-p/92427

"jack of all trades, master of none"
daradona10
New Member
October 21, 2024

No that doesn't work. Very frustrating