forked from JayRHa/IntuneScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChange-DeviceCategory.ps1
More file actions
34 lines (24 loc) · 822 Bytes
/
Copy pathChange-DeviceCategory.ps1
File metadata and controls
34 lines (24 loc) · 822 Bytes
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
<#
Version: 1.0
Author: Jannik Reinhard (jannikreinhard.com)
Script: Change-DeviceCategory
Description:
The script helps you to change the category of an intune device
Release notes:
Version 1.0: Init
#>
Connect-MSGraph
Update-MSGraphEnvironment -SchemaVersion 'beta'
function Change-DeviceCategory {
param(
[Parameter(Mandatory)]
[string]$DeviceID,
[Parameter(Mandatory)]
[string]$DeviceCategory
)
$body = @{ "@odata.id" = "https://graph.microsoft.com/beta/deviceManagement/deviceCategories/$DeviceCategory" }
Invoke-MSGraphRequest -HttpMethod PUT -Url "deviceManagement/managedDevices/$DeviceID/deviceCategory/`$ref" -Content $body
}
$DeviceID = 'ADD-DEVICE-ID'
$DeviceCategory = 'ADD-THE-DEVICE-CATEGORY-ID'
Change-DeviceCategory -DeviceID $DeviceID -DeviceCategory $DeviceCategory