# Netmaker Desktop - Intune Deployment Guide

### **📦 Overview**

This deployment will:

* Install Netmaker Desktop silently
* Configure the client with your Netmaker server
* Ensure Netmaker starts automatically on user login
* Launch the app immediately after installation

***

### **🧾 Prerequisites**

Before proceeding, ensure:

* You have access to **Microsoft Intune**
* You have the Netmaker Desktop installer:

  netmaker-desktop-installer.exe
* You know your Netmaker server address:

  <https://api.domain>

***

### **⚙️ Step 1 - Prepare Deployment Package**

Create a folder with:

netmaker-intune-package/

├── netmaker-desktop-installer.exe

├── install.ps1

***

### **📝 Step 2 - Configure Installation Script**

Create a file named:

install.ps1

Paste the script below and **replace your server domain**:

"server": "api.domain"   # <<< REPLACE THIS

```powershell
$ErrorActionPreference = "Stop"

# -------------------------------
# Logging Helpers
# -------------------------------
function Log-Info {
    param([string]$msg)
    Write-Output "[INFO] $msg"
}

function Log-Error {
    param([string]$msg)
    Write-Output "[ERROR] $msg"
}

function Log-Success {
    param([string]$msg)
    Write-Output "[SUCCESS] $msg"
}

# -------------------------------
# Paths
# -------------------------------
$FolderPath = "C:\Users\Public\netmaker-rac"
$FilePath   = "$FolderPath\ctx.json"
$ExePath    = ".\netmaker-desktop-installer.exe"
$AppPath    = "C:\Program Files\Netmaker Desktop\netmaker-desktop.exe"
$TaskName   = "NetmakerDesktopStartup"

# -------------------------------
# JSON content
# -------------------------------
$JsonContent = @'
{
  "server": "server.domain"
}
'@

try {

    # -------------------------------
    # Create folder
    # -------------------------------
    Log-Info "Creating config directory..."
    if (!(Test-Path $FolderPath)) {
        New-Item -ItemType Directory -Path $FolderPath -Force | Out-Null
    }

    # -------------------------------
    # Write JSON
    # -------------------------------
    Log-Info "Writing ctx.json..."
    $JsonContent | Set-Content -Path $FilePath -Encoding ASCII -Force

    # Validate JSON
    Log-Info "Validating configuration..."
    Get-Content $FilePath | ConvertFrom-Json | Out-Null

    # -------------------------------
    # Verify installer
    # -------------------------------
    Log-Info "Checking installer..."
    if (!(Test-Path $ExePath)) {
        Log-Error "Installer EXE not found"
        exit 1
    }

    # -------------------------------
    # Install
    # -------------------------------
    Log-Info "Installing Netmaker Desktop..."
    Start-Process $ExePath -ArgumentList "/quiet /norestart" -Wait

    # -------------------------------
    # Verify install
    # -------------------------------
    Log-Info "Verifying installation..."
    if (!(Test-Path $AppPath)) {
        Log-Error "Netmaker executable not found after installation"
        exit 1
    }

    # -------------------------------
    # Scheduled Task
    # -------------------------------
    Log-Info "Configuring startup task..."

    if (schtasks /Query /TN $TaskName 2>$null) {
        schtasks /Delete /TN $TaskName /F | Out-Null
    }

    schtasks /Create `
        /TN $TaskName `
        /TR "`"$AppPath`"" `
        /SC ONLOGON `
        /RL HIGHEST `
        /F | Out-Null

    # -------------------------------
    # Launch app
    # -------------------------------
    Log-Info "Launching Netmaker Desktop..."
    Start-Process -FilePath $AppPath

    Log-Success "Installation completed successfully"
    exit 0

}
catch {
    Log-Error $_.Exception.Message
    exit 1
}
```

***

#### **🔧 What the script does**

* Creates config file:

  C:\Users\Public\netmaker-rac\ctx.json
* Installs Netmaker silently
* Verifies installation
* Creates startup task
* Launches Netmaker

***

### **📁 Step 3 - Package for Intune**

Use Microsoft Win32 packaging tool:

IntuneWinAppUtil.exe -c \<folder> -s install.ps1 -o \<output-folder>

This generates:

netmaker.intunewin

***

### **☁️ Step 4 - Upload to Intune**

In Intune:

Apps → Windows → Add → Win32 app

Upload:

netmaker.intunewin

***

### **⚙️ Step 5 - Configure App Settings**

#### **🔹 Install command**

powershell.exe -ExecutionPolicy Bypass -File install.ps1

#### **🔹 Uninstall command (optional)**

"C:\Program Files\Netmaker Desktop\uninstall.exe" /quiet

***

### **🖥️ Step 6 - Detection Rule**

Set detection rule:

File exists:

C:\Program Files\Netmaker Desktop\netmaker-desktop.exe

***

### **👥 Step 7 - Assign to Users/Devices**

* Assign to:
  * Device group OR
  * User group

Recommended:

👉 Assign to **Devices** for consistency

***

### **🔄 Step 8 - Deployment Behavior**

Set:

* Install behavior: **System**
* Logon requirement: **Whether or not user is logged in**
* Device restart: **No specific action**

***

### **🔁 Step 9 - Verify Deployment**

After deployment:

#### **✅ Check installation**

C:\Program Files\Netmaker Desktop\netmaker-desktop.exe

#### **✅ Check config file**

C:\Users\Public\netmaker-rac\ctx.json

#### **✅ Check scheduled task**

schtasks /Query /TN NetmakerDesktopStartup

***

### **🚀 What happens on user machine**

* Netmaker installs silently
* Config is applied automatically
* App starts immediately
* App launches on every login

***

### **⚠️ Troubleshooting**

#### **❌ Installer not found**

* Ensure EXE is packaged with script

***

#### **❌ App not launching**

* Check scheduled task:

schtasks /Query /TN NetmakerDesktopStartup

***

#### **❌ JSON config invalid**

* Verify:

{

"server": "your-domain"

}

***

#### **❌ App not detected by Intune**

* Confirm detection path:

C:\Program Files\Netmaker Desktop\netmaker-desktop.exe

***

### **🔐 Security Notes**

* Script runs with **elevated privileges**
* Configuration stored in:

  C:\Users\Public\\
* Ensure server domain is correct and trusted


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.netmaker.io/how-to-guides/netmaker-desktop-intune-deployment-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
