cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
EHacking
Intrepid explorer

New Office 365 failed with error (400) Bad Request

Jump to solution

We have upgraded our Office 365 connector to the new connector, and have been running it successfully for two months now. All of a sudden it started to fail with an error: Inventory gathering failed. Error: The remote server returned an error: (400) Bad Request.

In the log we get the following: 2019-07-10 00:00:57,702 [INFO ]       Failed to execute Reader 'Get Users from Office 365' from file C:\ProgramData\Flexera Software\Compliance\ImportProcedures\Inventory\Reader\microsoft 365\User.xml, at step line 1 Error: The remote server returned an error: (400) Bad Request.

Erick Hacking, CSAM, CHAMP
IT Software Asset Manager, Lead Sr.
0 Kudos
1 Solution

Accepted Solutions
Highlighted
EHacking
Intrepid explorer

Re: New Office 365 failed with error (400) Bad Request

Jump to solution

I thought I would post my troubleshooting steps to resolution here so that others might benefit.

Alspesh at Flexera suggested I do the following:

Logon to this site using the account you have used to configure the new O365 connection --> https://developer.microsoft.com/en-us/graph/

Go to the Graph Explore page and on the GET field at the top of the page, you will see a graph api call. Copy this line in there --> https://graph.microsoft.com/v1.0/users/ and then click 'Run Query'

I received a "Success - Status Code 200" message, so the actual query that the script runs is working out on Microsoft's site, so I decided to check the connection again on the Beacon.

Edited the connection on the Beacon. Tested the connection and received the same Error 400 Bad Request.

There is an option to Refresh Token, so I clicked on Generate. I received a notification that the MSAUTH site it was trying to go to was not a trusted site, so I added the site to the list of trusted sites on the Beacon, ran the Generate again and this time it asked me to log onto the Microsoft Authentication site. I did so using the correct ID, then generated the token again. Saved it. Tested the connection and this time it succeeded. I saved the connection and executed. This time it runs successfully.

Hope this helps others in their troubleshooting.

Erick

Erick Hacking, CSAM, CHAMP
IT Software Asset Manager, Lead Sr.

View solution in original post

6 Replies
Highlighted
EHacking
Intrepid explorer

Re: New Office 365 failed with error (400) Bad Request

Jump to solution

I thought I would post my troubleshooting steps to resolution here so that others might benefit.

Alspesh at Flexera suggested I do the following:

Logon to this site using the account you have used to configure the new O365 connection --> https://developer.microsoft.com/en-us/graph/

Go to the Graph Explore page and on the GET field at the top of the page, you will see a graph api call. Copy this line in there --> https://graph.microsoft.com/v1.0/users/ and then click 'Run Query'

I received a "Success - Status Code 200" message, so the actual query that the script runs is working out on Microsoft's site, so I decided to check the connection again on the Beacon.

Edited the connection on the Beacon. Tested the connection and received the same Error 400 Bad Request.

There is an option to Refresh Token, so I clicked on Generate. I received a notification that the MSAUTH site it was trying to go to was not a trusted site, so I added the site to the list of trusted sites on the Beacon, ran the Generate again and this time it asked me to log onto the Microsoft Authentication site. I did so using the correct ID, then generated the token again. Saved it. Tested the connection and this time it succeeded. I saved the connection and executed. This time it runs successfully.

Hope this helps others in their troubleshooting.

Erick

Erick Hacking, CSAM, CHAMP
IT Software Asset Manager, Lead Sr.

View solution in original post

Highlighted
Flexera Alpesh
Flexera

Re: New Office 365 failed with error (400) Bad Request

Jump to solution
Hi Erick,

I am glad that the suggestion helped you in resolving the issue.

Thanks!
Highlighted
usman_javaid
Flexera beginner

Re: New Office 365 failed with error (400) Bad Request

Jump to solution
Hi, I am receiving exact error message in my Flexera Production instance. But I don't see any option to "refresh" token. Could you please advise.
0 Kudos
Highlighted
EHacking
Intrepid explorer

Re: New Office 365 failed with error (400) Bad Request

Jump to solution
Usman, this is on the beacon in the actual connector.
Erick Hacking, CSAM, CHAMP
IT Software Asset Manager, Lead Sr.
0 Kudos