Powershell error: Root element is missing

SR VSP 1,251 Reputation points
2021-01-20T15:33:42.65+00:00

Hi Guys,

I'm getting root element is missing error while running PS scripts can you advise if there is a fix from MS ?

I've already updated with latest version of PS.

58772-root-element.jpg

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | For business | Windows
Windows for business | Windows Server | User experience | PowerShell
{count} votes

Answer accepted by question author
  1. Echo Du_MSFT 17,341 Reputation points
    2021-01-21T01:31:56.553+00:00

    Hello @SR VSP ,

    Root Element Missing when connecting to SharePoint online via CSOM/Powershell on windows 10 machine

    This is a known issue specific to the particular machine where you are executing this code. In order to fix this issue, need to change the DNS setting in your machine.

    Please follow steps:

    1.Control Panel >> Network and Internet >> Network and Sharing Center >> Change adapter settings >> select the Network through which you are connecting to Internet

    58925-1.png

    2.Right click on it and select Properties >> select Internet Protocol Version 4 (TCP/IPV4) and click Properties

    58934-2.png

    3.Select "Use the following DNS Server Addresses" option and give the DNS whatever you want.

    • Google public DNS addresses : 8.8.8.8 and 8.8.8.4

    58882-3.png

    4.Click OK button to apply these changes.

    Thanks,
    Echo Du

    =====================

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Helmut Fritz 1 Reputation point
    2022-12-31T20:25:02.083+00:00

    Actually it seems having IPV6 enabled will cause this error. I did several experiments, and in the end disabling IPV6 did it for me. I did not need to change my IPV4 DNS servers.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.