grahamr975 / EWS-Office365-Contact-Sync

Uses Exchange Web Services to synchronize a Global Address List in Office 365 to a user's mailbox
MIT License
94 stars 21 forks source link

Identifying errors in the log #96

Closed De-Ge closed 8 months ago

De-Ge commented 8 months ago

Good morning! I wanted to firstly say that you and the others did an amazing job on the script, and it was very useful while it was working.

However at the moment we are currently experiencing issues with the script. While I'm relatively new with powershell I can't quite identify what steps I should take to get the script running again.

The current log gives me this error at some point. There is more to the log, however I'm just grabbing what was closest to the error.

VERBOSE: Exporting alias 'fimo'. VERBOSE: Exporting alias 'inmo'. VERBOSE: Exporting alias 'upmo'. VERBOSE: Exporting alias 'pumo'. VERBOSE: AutoGen EXOModule created at C:\Users\Administrator\AppData\Local\Temp\1\tmpEXO_kj0dh3t3.jdl VERBOSE: Running Configure-AppSettings VERBOSE: Setting PrintWarningsReceivedFromServer to False VERBOSE: PageSizes is set to: 1000 VERBOSE: Logs location is reset to C:\Users\Administrator\AppData\Local\Temp\1\EXOCmdletTelemetry VERBOSE: Max directory size reset to 2000000000 VERBOSE: Max log size reset to 100000000 VERBOSE: Log level reset to Default VERBOSE: Logger reset to null. VERBOSE: TrackPerformance is set to: False VERBOSE: ShowProgress is set to: False VERBOSE: UseMultithreading is set to: True VERBOSE: Computed version info: 3.2.0 VERBOSE: POST https://outlook.office365.com/adminapi/beta/aad6e0c7-b07b-44d6-85b7-38cf3ceeb105/InvokeCommand with -1-byte payload VERBOSE: received 465750-byte response of content type application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 VERBOSE: Returning precomputed version info: 3.2.0 VERBOSE: POST https://outlook.office365.com/adminapi/beta/aad6e0c7-b07b-44d6-85b7-38cf3ceeb105/InvokeCommand?$skiptoken=ADYjcxNWI3YTBkZTA4NDc4ZGFhNjQwMzk3Y2VlZTdkMGFTSjBQUjA5TUIxMDYxNQ== with -1-byte payload

TerminatingError(Invoke-WebRequest): "{"error":{"code":"BadRequest","message":"Invalid Operation","innererror":{"message":"Invalid Operation","type":"Microsoft.Exchange.Admin.OData.Core.ODataServiceException","stacktrace":" at Microsoft.Exchange.AdminApi.CommandInvocation.CommandInvocation.InvokeCommand(QueryContext queryContext, CmdletInvokeInputType cmdletInvokeInputType)\r\n at Microsoft.Exchange.Admin.OData.Core.PathSegmentToExpressionTranslator.Translate(OperationImportSegment segment)\r\n at Microsoft.Exchange.Admin.OData.Core.QueryContext.ResolveQuery(ODataContext context, Int32 level)\r\n at Microsoft.Exchange.Admin.OData.Core.Handlers.OperationHandler.ProcessAction(IODataRequestMessage requestMessage)\r\n at Microsoft.Exchange.Admin.OData.Core.Handlers.OperationHandler.Process(IODataRequestMessage requestMessage, IODataResponseMessage responseMessage)\r\n at Microsoft.Exchange.Admin.OData.Core.Handlers.RequestHandler.Process(Stream requestStream)","internalexception":{"message":"Expired or Invalid pagination request. Default Expiry time is 00:30:00","type":"System.Exception","stacktrace":""}},"adminapi.warnings@odata.type":"#Collection(String)","@adminapi.warnings":[]}}" VERBOSE: Query 1 failed. PS>TerminatingError(ConvertFrom-Json): "Invalid JSON primitive: Expired." PS>TerminatingError(Write-ErrorMessage): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Expired or Invalid pagination request. Default Expiry time is 00:30:00" TerminatingError(Write-ErrorMessage): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Expired or Invalid pagination request. Default Expiry time is 00:30:00" TerminatingError(Write-ErrorMessage): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Expired or Invalid pagination request. Default Expiry time is 00:30:00" PS>TerminatingError(Write-ErrorMessage): "Expired or Invalid pagination request. Default Expiry time is 00:30:00" PS>TerminatingError(Write-Log): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to fetch Global Address List Contacts from Office 365 Directory" TerminatingError(Write-Log): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to fetch Global Address List Contacts from Office 365 Directory" TerminatingError(Write-Log): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to fetch Global Address List Contacts from Office 365 Directory" TerminatingError(Write-Log): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to fetch Global Address List Contacts from Office 365 Directory" The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to fetch Global Address List Contacts from Office 365 Directory Write-Log : Failed to fetch Global Address List Contacts from Office 365 Directory At line:88 char:3

  • Write-Log -Level "FATAL" -Message "Failed to fetch Global Add ...
  • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
  • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Log

This script was very useful, so I will be keeping an eye on this thread and hopefully we can get it fixed!

EDIT: Updating the Exchange Online Powershell V3.2.0 has fixed the JSON issue, however the only issue I'm seeing is the "Failed to fetch Global Address List Contacts from Office 365 Directory"

Thank you so much for your work and your time.

grahamr975 commented 8 months ago

@De-Ge Can you please try to update to the latest version of the script? This might resolve the "Failed to fetch Global Address List Contacts from Office 365 Directory" issue.