[GH-ISSUE #2293] Window CLI #4819

Closed
opened 2026-08-05 00:59:49 -04:00 by saavagebueno · 1 comment
Owner

Originally created by @ismail0234 on GitHub (Jul 20, 2024).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/2293

Hello,

Is it possible to install and use this program in windows via command line? In a project I am using, I would like to be able to silently install this program and join the network with the command line.

Originally created by @ismail0234 on GitHub (Jul 20, 2024). Original GitHub issue: https://github.com/netbirdio/netbird/issues/2293 Hello, Is it possible to install and use this program in windows via command line? In a project I am using, I would like to be able to silently install this program and join the network with the command line.
saavagebueno added the feature-request label 2026-08-05 00:59:49 -04:00
Author
Owner

@roberthase commented on GitHub (Jul 21, 2024):

I use the following powershell script in our gpo for installing and updating netbird from a fileshare/netlogon on windows client-computers:
You might want to use a wmi filter which only applies to battery powered devices like notebooks and tablets.


$currentVersion = "0.28.4.9780101341"   
$installedVersion = Get-ItemPropertyValue HKLM:SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Netbird -Name DisplayVersion

#this part sets the version you want to be installed and which is installed on the computer.

if ($installedVersion -ne $currentVersion) {
    Copy-Item "\\your\fileshare\netbird0.28.4.exe" "C:\Temp\netbird0.28.4.exe" -Force #this copies the netbird installer to a local directory
    Start-Process "C:\Temp\netbird0.28.4.exe" -ArgumentList "/S" -NoNewWindow -Wait

#if the installed version is not the version you want be installed, the netbirdinstaller gets copied on to the local computer and is installed (this part is important, if you are updating from outside the network as netbird gets completly reinstalled(netbird is gone and your computer cant access the fileshare anymore)

    Start-Sleep -Seconds 15
    $Env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
    Start-Sleep -Seconds 15

#this renews the variables so you can use the netbird up command in the same script

    netbird up --setup-key "YOURKEY" --management-url https://your.url:33073
    Remove-Item "C:\Temp\netbird0.28.4.exe" -Force

#this part connects netbird to your controller with a setupkey und removes the installer

    echo "Netbird installed/updated to version $currentVersion"
} else {
    echo "Netbird is already up to date with version $currentVersion"
}

#if netbird is installed and the current version the script does nothing

<!-- gh-comment-id:2241588268 --> @roberthase commented on GitHub (Jul 21, 2024): I use the following powershell script in our gpo for installing and updating netbird from a fileshare/netlogon on windows client-computers: You might want to use a wmi filter which only applies to battery powered devices like notebooks and tablets. ``` $currentVersion = "0.28.4.9780101341" $installedVersion = Get-ItemPropertyValue HKLM:SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Netbird -Name DisplayVersion ``` _#this part sets the version you want to be installed and which is installed on the computer._ ``` if ($installedVersion -ne $currentVersion) { Copy-Item "\\your\fileshare\netbird0.28.4.exe" "C:\Temp\netbird0.28.4.exe" -Force #this copies the netbird installer to a local directory Start-Process "C:\Temp\netbird0.28.4.exe" -ArgumentList "/S" -NoNewWindow -Wait ``` _#if the installed version is not the version you want be installed, the netbirdinstaller gets copied on to the local computer and is installed (this part is important, if you are updating from outside the network as netbird gets completly reinstalled(netbird is gone and your computer cant access the fileshare anymore)_ ``` Start-Sleep -Seconds 15 $Env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User") Start-Sleep -Seconds 15 ``` _#this renews the variables so you can use the netbird up command in the same script_ ``` netbird up --setup-key "YOURKEY" --management-url https://your.url:33073 Remove-Item "C:\Temp\netbird0.28.4.exe" -Force ``` _#this part connects netbird to your controller with a setupkey und removes the installer_ ``` echo "Netbird installed/updated to version $currentVersion" } else { echo "Netbird is already up to date with version $currentVersion" } ``` _#if netbird is installed and the current version the script does nothing_
Sign in to join this conversation.
No Label feature-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#4819