ThomasKur / M365Documentation

Automatic Microsoft 365 Documentation to simplify the life of admins and consultants.
Other
300 stars 45 forks source link

Receiving 'Request_ResourceNotFound' Errors #18

Open garricko42 opened 2 years ago

garricko42 commented 2 years ago

Hello Thomas,

Getting some errors after connecting and when running: $doc = Get-M365Doc -Components Intune -ExcludeSections "MobileAppDetailed"

The script seems to run without issue until the end when I start to receive Request_ResourceNotFound errors. This is what I'm finding in Event Viewer:

Error Message = {"error":{"code":"Request_ResourceNotFound","message":"Resource 'GUID' does not exist or one of its queried reference-property objects are not present.","innerError":{"date":"2022-01-24T20:36:01","request-id":"GUID","client-request-id":"GUID"}}}
Fully Qualified Error ID = WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Recommended Action = 

Context:
        Severity = Warning
        Host Name = ConsoleHost
        Host Version = 7.2.1
        Host ID = GUID
        Host Application = C:\Program Files\PowerShell\7\pwsh.dll
        Engine Version = 7.2.1
        Runspace ID = GUID
        Pipeline ID = 111
        Command Name = Invoke-RestMethod
        Command Type = Cmdlet
        Script Name = C:\Users\xxxxxxxxxx\Documents\PowerShell\Modules\M365Documentation\3.1.2\Internal\Helper\Invoke-DocGraph.ps1
        Command Path = 
        Sequence Number = 111
        User = xxxxxxxxxx
        Connected User = 
        Shell ID = Microsoft.PowerShell

User Data:

The errors are being reported from lines 25 and 36.

Running the last command to generate the docx file produces a document with just the default images and headings, no data.

I am running all commands in an elevated command prompt and connecting with a GA account.

I have checked my resources/modules and imported as many as I could find.

Have you encountered this issue before? Suggestions on where to focus my troubleshooting efforts?

Thank you

duckiecto commented 2 years ago

I am receiving this error with a GA account with MFA enabled. There is no issue connecting and have tried running $doc = Get-M365Doc -Components Intune with the same error.

As a follow up I ran a clean install of Windows 10 in a VM with Powershell 7.2.1 (latest installer) and received the same error.

davidmonk-cbts commented 4 months ago

I just installed from PowerShell Gallery today. Running PS 7.4.1 on Windows 11. I am getting the same. I think the line 25 and 36 errors have to do with some missing assignment. Likely no big deal. All the data gets collected.  When running Write-M365DocWord I get a lot of errors along the lines of "The property 'Width' cannot be found on this object" or "Cannot bind argument to parameter 'Document' because it is null." And a final warning that the document could not be saved. I was able to run Write-M365DocMd with no errors and what appears to be full output. I have PSWord, PSWriteWord, and PSWriteOffice installed.