# jseerden/intunebackupandrestore architecture

> Architecture diagram of the GitHub repository jseerden/intunebackupandrestore, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jseerden/intunebackupandrestore
- Repository: https://github.com/jseerden/intunebackupandrestore

## Overview

IntuneBackupAndRestore is a PowerShell module for querying Microsoft Graph and backing up Intune configuration to JSON files, with cross-tenant restore and backup comparison capabilities. The documented full workflow uses separate restore commands for configurations and assignments; individual resource handlers cover the documented configuration categories. No source excerpts were provided, so relationships beyond those explicitly described in the README are omitted.

Main entry points: [`IntuneBackupAndRestore/Public/Start-IntuneBackup.ps1`](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Start-IntuneBackup.ps1) (Backup command), [`IntuneBackupAndRestore/Public/Start-IntuneRestoreConfig.ps1`](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Start-IntuneRestoreConfig.ps1) (Restore configs), [`IntuneBackupAndRestore/Public/Start-IntuneRestoreAssignments.ps1`](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Start-IntuneRestoreAssignments.ps1) (Restore assignments), [`IntuneBackupAndRestore/Public/Compare-IntuneBackupFile.ps1`](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Compare-IntuneBackupFile.ps1) (Compare files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Backup and restore"]
  node_backup["Backup command"]
  node_restoreconfig["Restore configs"]
  node_restoreassign["Restore assignments"]
end

subgraph group_resources["Intune resources"]
  node_policies["Policies and configs"]
  node_assignments["Resource assignments"]
  node_apps["Client apps"]
  node_autopilot["Autopilot profiles"]
  node_scripts["Management scripts"]
  node_security["Endpoint security"]
end

subgraph group_comparison["Backup comparison"]
  node_comparefiles["Compare files"]
  node_comparedirs["Compare directories"]
end

node_user(("Operator"))
node_graph["Microsoft Graph"]
node_json[("Backup JSON files")]

node_user -->|"starts backup"| node_backup
node_user -->|"starts restore"| node_restoreconfig
node_user -->|"starts restore"| node_restoreassign
node_backup -->|"queries"| node_graph
node_backup -->|"writes backup"| node_json
node_restoreconfig -->|"reads backup"| node_json
node_restoreassign -->|"reads backup"| node_json
node_user -->|"compares files"| node_comparefiles
node_user -->|"compares directories"| node_comparedirs
node_comparefiles -->|"compares files"| node_json
node_comparedirs -->|"compares backups"| node_json

click node_backup "https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Start-IntuneBackup.ps1"
click node_restoreconfig "https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Start-IntuneRestoreConfig.ps1"
click node_restoreassign "https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Start-IntuneRestoreAssignments.ps1"
click node_policies "https://github.com/jseerden/intunebackupandrestore/tree/master/IntuneBackupAndRestore/Public"
click node_assignments "https://github.com/jseerden/intunebackupandrestore/tree/master/IntuneBackupAndRestore/Public"
click node_apps "https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Invoke-IntuneBackupClientApp.ps1"
click node_autopilot "https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Invoke-IntuneBackupAutopilotDeploymentProfile.ps1"
click node_scripts "https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Invoke-IntuneBackupDeviceManagementScript.ps1"
click node_security "https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Invoke-IntuneBackupDeviceManagementIntent.ps1"
click node_comparefiles "https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Compare-IntuneBackupFile.ps1"
click node_comparedirs "https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Compare-IntuneBackupDirectories.ps1"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_backup,node_restoreconfig,node_restoreassign toneBlue
class node_policies,node_assignments,node_apps,node_autopilot,node_scripts,node_security,node_json toneAmber
class node_comparefiles,node_comparedirs toneMint
class node_user,node_graph toneIndigo
```

## Components

### Backup and restore

- [Backup command](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Start-IntuneBackup.ps1): `IntuneBackupAndRestore/Public/Start-IntuneBackup.ps1`
- [Restore configs](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Start-IntuneRestoreConfig.ps1): `IntuneBackupAndRestore/Public/Start-IntuneRestoreConfig.ps1`
- [Restore assignments](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Start-IntuneRestoreAssignments.ps1): `IntuneBackupAndRestore/Public/Start-IntuneRestoreAssignments.ps1`

### Intune resources

- [Policies and configs](https://github.com/jseerden/intunebackupandrestore/tree/master/IntuneBackupAndRestore/Public): `IntuneBackupAndRestore/Public`
- [Resource assignments](https://github.com/jseerden/intunebackupandrestore/tree/master/IntuneBackupAndRestore/Public): `IntuneBackupAndRestore/Public`
- [Client apps](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Invoke-IntuneBackupClientApp.ps1): `IntuneBackupAndRestore/Public/Invoke-IntuneBackupClientApp.ps1`
- [Autopilot profiles](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Invoke-IntuneBackupAutopilotDeploymentProfile.ps1): `IntuneBackupAndRestore/Public/Invoke-IntuneBackupAutopilotDeploymentProfile.ps1`
- [Management scripts](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Invoke-IntuneBackupDeviceManagementScript.ps1): `IntuneBackupAndRestore/Public/Invoke-IntuneBackupDeviceManagementScript.ps1`
- [Endpoint security](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Invoke-IntuneBackupDeviceManagementIntent.ps1): `IntuneBackupAndRestore/Public/Invoke-IntuneBackupDeviceManagementIntent.ps1`

### Backup comparison

- [Compare files](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Compare-IntuneBackupFile.ps1): `IntuneBackupAndRestore/Public/Compare-IntuneBackupFile.ps1`
- [Compare directories](https://github.com/jseerden/intunebackupandrestore/blob/master/IntuneBackupAndRestore/Public/Compare-IntuneBackupDirectories.ps1): `IntuneBackupAndRestore/Public/Compare-IntuneBackupDirectories.ps1`

### Other components

- **Operator**
- **Microsoft Graph**
- **Backup JSON files**

## Connections

- Operator → Backup command: starts backup (evidence: `README.md`)
- Operator → Restore configs: starts restore (evidence: `README.md`)
- Operator → Restore assignments: starts restore (evidence: `README.md`)
- Backup command → Microsoft Graph: queries (evidence: `README.md`)
- Backup command → Backup JSON files: writes backup (evidence: `README.md`)
- Restore configs → Backup JSON files: reads backup (evidence: `README.md`)
- Restore assignments → Backup JSON files: reads backup (evidence: `README.md`)
- Operator → Compare files: compares files (evidence: `README.md`)
- Operator → Compare directories: compares directories (evidence: `README.md`)
- Compare files → Backup JSON files: compares files (evidence: `README.md`)
- Compare directories → Backup JSON files: compares backups (evidence: `README.md`)
