You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New-GraphPOSTRequest-uri "https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeviceIdentities/$($request.body.Device)/UpdateDeviceProperties"-tenantid $TenantFilter-body $body-method POST
21
-
$Results="Successfully assigned device to $($Request.body.UserPrincipalName) for $($tenantfilter)"
26
+
New-GraphPOSTRequest-uri "https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeviceIdentities/$($DeviceObject)/UpdateDeviceProperties"-tenantid $TenantFilter-body $body-method POST |Out-Null
27
+
Write-LogMessage-user $User-API $APINAME-message "Successfully assigned device: $DeviceObject with Serial: $SerialNumber to $($UserObject.userPrincipalName) for $($TenantFilter)"-Sev Info
28
+
$Results="Successfully assigned device: $DeviceObject with Serial: $SerialNumber to $($UserObject.userPrincipalName) for $($TenantFilter)"
29
+
$StatusCode= [HttpStatusCode]::OK
22
30
} catch {
23
-
$Results="Could not $($Request.body.UserPrincipalName) to $($Request.body.device) for $($tenantfilter) Error: $($_.Exception.Message)"
31
+
$ErrorMessage=Get-CippException-Exception $_
32
+
Write-LogMessage-user $User-API $APINAME-message "Could not assign $($UserObject.userPrincipalName) to $($DeviceObject) for $($TenantFilter) Error: $($ErrorMessage.NormalizedError)"-Sev Error -LogData $ErrorMessage
33
+
$Results="Could not assign $($UserObject.userPrincipalName) to $($DeviceObject) for $($TenantFilter) Error: $($ErrorMessage.NormalizedError)"
0 commit comments