Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions removeAutoPilotdevices.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +53 to +57


# Paths to files
Expand Down