-
Notifications
You must be signed in to change notification settings - Fork 16
/
01_01_Backup.ps1
43 lines (29 loc) · 1.12 KB
/
01_01_Backup.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#Thank your very much to John Seerden! @jseerden
Set-Location c:\
Clear-Host
#Customize the ExecutionPolicy (absolutely OK for this demo)
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
#Install the Module
Install-Module -Name Microsoft.Graph.Intune -Verbose -Force -AllowClobber
#Install the Module
Install-Module -Name MSGraphFunctions -Verbose -Force -AllowClobber
#Import the Module
Import-Module -Name MSGraphFunctions
#Install the Module
Install-Module -Name AzureAD -Verbose -Force -AllowClobber
#Install IntuneBackupAndRestore from the PowerShell Gallery
Install-Module -Name IntuneBackupAndRestore -Verbose -Force -AllowClobber
#Update the Module
Update-Module -Name IntuneBackupAndRestore -Verbose
#Import the Module
Import-Module IntuneBackupAndRestore
#Connect to Microsoft Graph
Connect-MSGraph
#Create a folder
New-Item -ItemType Directory -Path C:\Backup\IntuneBackup
#Switch to the folder
Set-Location C:\Backup\IntuneBackup
#Create the Full-Backup
Start-IntuneBackup -Path 'C:\Backup\IntuneBackup'
#Let's look at the content
Get-ChildItem -Path 'C:\Backup\IntuneBackup'