netbird
netbird copied to clipboard
Pass management-url to msi installer.
Is your feature request related to a problem? Please describe. We struggling to autodeploy MSI installer to our Windows users with custom management-url.
Describe the solution you'd like An option to provide management-url address to MSI packet during installation.
You can populate the values in %PROGRAMDATA%/Netbird/config.json as an alternative, would that help?
We managed to create custom msi installer with powershell script that populate needed value in config.json after installation.
@svardie Would you by any chance be able to share details on creating the custom installer to do this? (I'm a linux guy that has been dropped in the deep end with windows admin and using Intune)
@nicjohnston Sure. Here it is.
((Get-Content -path "C:\ProgramData\Netbird\config.json" -Raw) -replace 'api.netbird.io:443','your_custom_url') | Set-Content -Path "C:\ProgramData\Netbird\config.json"
We modified official Netbird msi installer with Advanced Installer software and stick this powershell script in it.
If you are using Microsoft Intune, then possible scenario can be to deploy official msi-packet without changing it, and then run PS script on clients via Intune. Maybe i am wrong, not worked with Intune.
Hope this will help.
I used the below instead to acheive basically the same thing. It also changes the admin url too.
'# Define the path to the config file $configFilePath = "C:\ProgramData\Netbird\config.json"
Check if the config file exists
if (Test-Path -Path $configFilePath) { # Read the content of the config file $configContent = Get-Content -Path $configFilePath -Raw | ConvertFrom-Json
# Check if the Host values are correct
$isUpdated = $false
if ($configContent.ManagementURL.Host -ne "<self-hosted-url>:33073") {
$configContent.ManagementURL.Host = "<self-hosted-url>:33073"
$isUpdated = $true
}
if ($configContent.AdminURL.Host -ne "<self-hosted-url>:443") {
$configContent.AdminURL.Host = "<self-hosted-url>:443"
$isUpdated = $true
}
# If updates were made, convert the updated content back to JSON format and write it back to the file
if ($isUpdated) {
$updatedConfigContent = $configContent | ConvertTo-Json -Depth 10
Set-Content -Path $configFilePath -Value $updatedConfigContent
Write-Output "Config file updated successfully."
} else {
Write-Output "Config file is already up to date."
}
} else { Write-Output "Config file does not exist. No changes made." }'