diff --git a/removeAutoPilotdevices.ps1 b/removeAutoPilotdevices.ps1 index 8b3dbad..1a65c7e 100644 --- a/removeAutoPilotdevices.ps1 +++ b/removeAutoPilotdevices.ps1 @@ -46,11 +46,15 @@ function Check-Module ($m) { Write-Host "`nConnecting to MgGraph`n" Connect-MgGraph -NoWelcome + + # If you have issues connecting and you use MFA in your tenant, use the Connect-MgGraph with the following flag: + # Connect-MgGraph -NoWelcome -UseDeviceAuthentication + # Removed the MSGraph calls. The MSGraph module is deprecated and will throw Application ID not found errors. Use modern MgGraph calls instead. # Connecting with MSGraph might give a problem if module Microsoft.Graph.Intune is not imported - Write-Host "`nConnecting to MSGraph`n" - Update-MSGraphEnvironment -AppId 9a9fdd0a-4fe1-42ce-8dcf-f9e5c90344b3 - Connect-MSGraph + # Write-Host "`nConnecting to MSGraph`n" + # Update-MSGraphEnvironment -AppId 9a9fdd0a-4fe1-42ce-8dcf-f9e5c90344b3 + # Connect-MSGraph # Paths to files