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
I keep getting this error when checking the log file on a number of devices when offboarding even though I have checked those devices exist in Entra ID and Intune: "Error in offboarding operation. Exception: Cannot process argument transformation on parameter 'DeviceId'. Cannot convert value to type System.String."
I have also checked the device name and there is nothing unusual in the name. Any ideas or has anyone else seen this issue?
Thanks
The text was updated successfully, but these errors were encountered:
Also noticed this script cannot handle duplicate entries found in Entra ID, which isn't great if you have to then go in manually to delete from Entra ID.
I tried some cases where there were only some "objects" available between AP, Intune, and AAD, and not all three.
This also seemed to cause some problems for searching devices and serials.
I was also looking at adding individual "offboard" buttons for each area to test finding/removing individual objects.
$OffboardButton2.Add_Click({
if ($AuthenticateButton.IsEnabled) {
Write-Log "User is not connected to MS Graph. Attempted offboarding operation."
[System.Windows.MessageBox]::Show("You are not connected to MS Graph. Please connect first.")
return
}
$confirmationResult = [System.Windows.MessageBox]::Show("Are you sure you want to proceed with INTUNE offboarding? This action cannot be undone.", "Confirm Offboarding", [System.Windows.MessageBoxButton]::YesNo)
if ($confirmationResult -eq 'No') {
Write-Log "User canceled offboarding operation."
return
}
try {
$SearchTexts = $SearchInputText.Text -split ', '
foreach ($SearchText in $SearchTexts) {
if (![string]::IsNullOrEmpty($SearchText)) {
$IntuneDevice = Get-MgDeviceManagementManagedDevice -Filter "deviceName eq '$SearchText'" -ErrorAction Stop
if ($IntuneDevice) {
Remove-MgDeviceManagementManagedDevice -ManagedDeviceId $IntuneDevice.Id -PassThru -ErrorAction Stop
[System.Windows.MessageBox]::Show("Successfully removed device $SearchText from INTUNE.")
$Window.FindName('intune_status').Text = "Intune: Unavailable"
Write-Log "Successfully removed device $SearchText from INTUNE."
}
else {
[System.Windows.MessageBox]::Show("Device $SearchText not found in INTUNE.")
}
}
else {
[System.Windows.MessageBox]::Show("Please provide a valid INTUNE device name.")
}
}
}
catch {
Write-Log "Error in INTUNE offboarding operation. Exception: $_"
[System.Windows.MessageBox]::Show("Error in INTUNE offboarding operation. Please ensure device names are valid.")
}
})
I keep getting this error when checking the log file on a number of devices when offboarding even though I have checked those devices exist in Entra ID and Intune:
"Error in offboarding operation. Exception: Cannot process argument transformation on parameter 'DeviceId'. Cannot convert value to type System.String."
I have also checked the device name and there is nothing unusual in the name. Any ideas or has anyone else seen this issue?
Thanks
The text was updated successfully, but these errors were encountered: