Deploy NetBird to Windows domain clients via Group Policy with a hardened security posture.
Two PowerShell scripts work together across boot/login cycles to:
- Silently install NetBird from a network share (first boot, runs as SYSTEM)
- Connect with security flags and trigger SSO authentication (first login, runs as user)
- Lock down settings so users cannot modify them (second boot, runs as SYSTEM)
After deployment, the client has these restrictions enforced and locked:
| Flag | Effect |
|---|---|
--block-inbound |
No inbound connections to the peer |
--block-lan-access |
Peer cannot access the local LAN |
--disable-server-routes |
Peer cannot act as a routing peer |
--disable-auto-connect |
User must manually connect/disconnect |
--disable-update-settings |
GUI settings are read-only |
--disable-profiles |
Cannot switch NetBird accounts |
The deployment uses two GPO scripts that work together across two boot/login cycles:
| Step | When | What Happens |
|---|---|---|
| 1 | First boot | Startup script silently installs NetBird |
| 2 | First login | Logon script runs netbird up with security flags, user completes SSO in browser |
| 3 | Second boot | Startup script detects flags were applied and locks down the client settings |
| 4 | All future logins | Everything is in place, scripts detect this and skip all steps |
- NetBird installer (
netbird_installer_x.x.x_windows_amd64.exe) hosted on a network share accessible by domain computers - GPO permissions to create Computer and User policies
- NetBird Cloud account with Microsoft SSO configured
Deploy-NetBird-Startup.ps1— Installs NetBird and applies settings lockdown. Runs as SYSTEM via GPO Computer Startup.Deploy-NetBird-Logon.ps1— Connects with security flags and triggers SSO. Runs as the logged-in user via GPO User Logon.
- Copy the NetBird installer to a network share accessible by domain computers (e.g.,
\\server\share\) - Copy both
.ps1scripts to a share accessible by GPO (e.g.,\\domain\SYSVOL\yourdomain\scripts\) - Update
$installerPathinDeploy-NetBird-Startup.ps1to match your share path
- Open Group Policy Management Console
- Create a new GPO (e.g., "NetBird Deployment") and link it to the OU containing your target computers
- Edit the GPO
- Navigate to Computer Configuration > Policies > Windows Settings > Scripts > Startup
- Go to the PowerShell Scripts tab
- Click Add and browse to
Deploy-NetBird-Startup.ps1
- Navigate to User Configuration > Policies > Windows Settings > Scripts > Logon
- Go to the PowerShell Scripts tab
- Click Add and browse to
Deploy-NetBird-Logon.ps1
If your environment restricts PowerShell execution, add this GPO setting:
- Computer Configuration > Administrative Templates > Windows Components > Windows PowerShell
- Set Turn on Script Execution to Enabled and select Allow all scripts
Alternatively, scope it tighter with Allow local scripts and remote signed scripts and sign both scripts.
All activity is logged to C:\ProgramData\Netbird\deploy.log with timestamps and script source labels ([Startup] or [Logon:username]).
| Issue | Cause | Fix |
|---|---|---|
| NetBird not installing | Installer path incorrect or inaccessible | Verify $installerPath and share permissions for the computer account |
| SSO prompt not appearing | Logon script ran before install | Will resolve on next login after install completes |
| Settings not locked | Only one boot cycle completed | Lockdown applies on the second boot after first login. Reboot once more. |
| Need to re-apply lockdown | After reinstall | Delete .lockdown-applied and .flags-applied from C:\ProgramData\Netbird\ |
| Need to temporarily unlock settings for support | Planned maintenance | Delete .lockdown-applied, run netbird service reconfigure (no flags), restart service |
From another NetBird peer, ping the deployed machine's NetBird IP. If BlockInbound is active, the ping will time out.
On the client, run:
netbird status -d
This shows the current connection state and active settings.
The NetBird team is working on an updated management GUI that will make configuring lockdown policies like these easier to manage at scale. These scripts are a stopgap for organizations that need this functionality today via GPO.
- No inbound firewall ports are needed on any peer when using NetBird Cloud. All connections use outbound NAT traversal.
BlockInboundandBlockLANAccessensure the laptop cannot be used as a gateway to the user's home or office network.DisableServerRoutesprevents the client from acting as a routing peer.DisableAutoConnectensures tunnels are only active when the user explicitly connects.--disable-update-settingslocks the GUI so users cannot change any of these settings.--disable-profilesprevents users from switching to a different NetBird account.- RDP over NetBird will be blocked by
BlockInbound. If remote support is needed, the user can be instructed to temporarily re-enable server routes once settings are unlocked by an admin.