Ensure proper deployment sequencing so FortiClient installs before the configuration script runs. This prevents script failures due to missing application files.
Set up app dependencies in Intune to control installation order:
Edit your FortiClient VPN app in Intune and go to Properties > Dependencies > Add
Configure dependency relationships if you have prerequisite software (like specific certificates or network drivers).
For the PowerShell script, create a remediation script that checks for FortiClient before applying configuration:
# Enhanced configuration script with dependency checking
$MaxRetries = 5
$RetryDelay = 30
for ($i = 1; $i -le $MaxRetries; $i++) {
$FortiClientPath = "C:\Program Files\Fortinet\FortiClient\FortiClient.exe"
if (Test-Path $FortiClientPath) {
Write-Output "FortiClient found, proceeding with configuration..."
# Run your configuration code here
break
} else {
Write-Output "Attempt $i: FortiClient not found, waiting $RetryDelay seconds..."
if ($i -eq $MaxRetries) {
Write-Error "FortiClient installation not detected after $MaxRetries attempts"
exit 1
}
Start-Sleep -Seconds $RetryDelay
}
}
Configure assignment filters to target specific device groups or exclude devices that shouldn't receive the VPN configuration:
{
"filterType": "include",
"rule": "(device.deviceOwnership -eq \"Corporate\") and (device.operatingSystem -eq \"Windows\")"
}
Set up monitoring and reporting:
- Create a custom device compliance policy that checks for VPN configuration
- Use Intune reporting to track deployment success rates
- Set up alerts for failed deployments
Pro tip: Use Intune's "Required" assignment for critical business applications and "Available" for optional tools. This ensures VPN gets deployed automatically while giving users control over optional software.
Verification: Check the deployment timeline in Intune device details to confirm FortiClient installs before the configuration script runs. Test on a pilot device to verify the complete workflow.