Geräte-Tab: Wipe-Aktion mit Benutzerdaten-Option, Suchfeld vergrößert
Wipe-Button mit eigenem Modal: Checkbox ob Benutzerdaten behalten werden (keepUserData). Suchfeld auf max-width 600px vergrößert. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -1622,7 +1622,7 @@ function Invoke-DeviceActionEndpoint {
|
||||
if ($err) { return $err }
|
||||
|
||||
$action = [string]$Body.action
|
||||
$allowed = @('syncDevice','rebootNow','remoteLock','collectDiagnostics','rotateBitLockerKeys','retire','autopilotReset')
|
||||
$allowed = @('syncDevice','rebootNow','remoteLock','collectDiagnostics','rotateBitLockerKeys','retire','autopilotReset','wipe')
|
||||
if ($action -notin $allowed) {
|
||||
return @{ statusCode = 400; error = "Unbekannte Aktion: $action" }
|
||||
}
|
||||
@@ -1630,6 +1630,10 @@ function Invoke-DeviceActionEndpoint {
|
||||
if ($action -eq 'autopilotReset') {
|
||||
$uri = "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/$DeviceId/wipe"
|
||||
$bodyJson = '{"keepEnrollmentData":true,"keepUserData":false}'
|
||||
} elseif ($action -eq 'wipe') {
|
||||
$keepUserData = if ($Body.keepUserData) { 'true' } else { 'false' }
|
||||
$uri = "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/$DeviceId/wipe"
|
||||
$bodyJson = "{""keepEnrollmentData"":false,""keepUserData"":$keepUserData}"
|
||||
} else {
|
||||
$uri = "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/$DeviceId/$action"
|
||||
$bodyJson = '{}'
|
||||
|
||||
Reference in New Issue
Block a user