Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script stopped working #22

Closed
dmaglinte77 opened this issue Nov 3, 2020 · 11 comments
Closed

Script stopped working #22

dmaglinte77 opened this issue Nov 3, 2020 · 11 comments
Assignees
Labels
question Further information is requested

Comments

@dmaglinte77
Copy link

This script stopped working for me at the end of september. MFA has been enabled in our tenant, but the user that I'm using to for the script has been excluded. But no matter what I do I cannot seem to get the script to work. Has anyone else seen this issue?
Capture

@grahamr975
Copy link
Owner

grahamr975 commented Nov 5, 2020

Are you sure that the user is excluded? That portion of the script doesn't depend on application impersonation or EWS. I'd suggest you double-check the credentials. You can test by manually running the below code in a PowerShell window. It should return a list of all users.

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $ConnectionUri -Credential Get-Credential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking -AllowClobber
	
		# Import Global Address List into Powershell from Office 365 Exchange as an array
		$ContactList = Get-User -ResultSize unlimited

@grahamr975 grahamr975 self-assigned this Nov 5, 2020
@grahamr975 grahamr975 added the question Further information is requested label Nov 5, 2020
@dmaglinte77
Copy link
Author

dmaglinte77 commented Nov 5, 2020 via email

@grahamr975
Copy link
Owner

@dmaglinte77 I don't see the error message?

@dmaglinte77
Copy link
Author

ScriptError

@grahamr975
Copy link
Owner

Yep, definitely looks like an authentication issue with the account you're using. Could be one or more of the below issues:

  1. Invalid username/password
  2. Basic authentication is disabled in your environment
  3. The account lacks Exchange Online admin access

I'd suggest you follow Microsoft's troubleshooting guide here and verify that basic authentication is enabled for the account.

@dmaglinte77
Copy link
Author

dmaglinte77 commented Nov 6, 2020

Good morning!
I was able to make some progress. I had to go into the MFA settings inside Org Settings and allow Exchange Online Powershell to use Basic Auth. But now I'm getting different errorS:

PS>TerminatingError(Connect-EXCExchange): "Exception calling "AutodiscoverUrl" with "2" argument(s): "The Autodiscover service couldn't be located.""

TerminatingError(Connect-EXCExchange): "Exception calling "AutodiscoverUrl" with "2" argument(s): "The Autodiscover service couldn't be located.""
2020/11/06 10:57:08 ERROR Failed to Sync-ContactList for 12345@12345.org Exception calling "AutodiscoverUrl" with "2" argument(s): "The Autodiscover service couldn't be located."

@grahamr975
Copy link
Owner

Looks like you're using basic EWS authentication (Negotiate Auth), which your environment is probably also blocking. Can you try using the latest version of the script along with the -ModernAuth flag? Make sure to follow the new instructions found in the read me.

@dmaglinte77
Copy link
Author

No dice. I re-downloaded your code and ran it again. Made sure -ModernAuth was set, but still getting that same error message.

@grahamr975
Copy link
Owner

grahamr975 commented Sep 15, 2022

@dmaglinte77 The newest version of the script now uses an AzureApp so it completely bypasses MFA-related issues. Please update and follow the guide in the README.md to resolve this issue.

@dmaglinte77
Copy link
Author

dmaglinte77 commented Sep 27, 2022 via email

@grahamr975
Copy link
Owner

@dmaglinte77

I'd recommend updating soon.

Microsoft will depreciate basic authentication (used by the old script) on October 1st, 2022. Tenets will have the opportunity to manually delay the depreciation until December 31st, 2022 on a per-protocol basis. See below.

https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-deprecation-in-exchange-online-september/ba-p/3609437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants