Could not establish connection to IIS Server. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). (or Invalid namespace)

You are setting up a new server with IIS and you have another server doing remote stopping/starting of the websites, and you’re getting the following error:

Could not establish connection to IIS Server. Access is denied.

or

Could not establish connection to IIS Server. Invalid namespace.

In my case, our FinalBuilder server was throwing this error trying to stop a remote IIS website.

What you need to do is enable the IIS Management Scripts and Tools role of your IIS server:

iismanagementscriptandtools

Leave a comment