Share via

How do you use the ServerManager.OpenRemote("servername"). There is NO documentation on MSDN or any of the website on how it works. Microsoft Support Consultant is not able to assist and doesn't know either

Anonymous
2024-10-28T16:26:48.8233333+00:00

How do you use the ServerManager.OpenRemote("servername"). There is NO documentation on MSDN or any of the website on how it works. Microsoft Support Consultant is not able to assist and doesn't know either, where the support docs is.

Please help.

Did anyone at Microsoft ever got this correct and made it work.

I have research and nobody Online in any forum was able to ever make use of this method to get it actually working.

Please help anyone.

See my code below:

using (var iisManager = ServerManager.OpenRemote("serverNameHere"))

{

var appPool = iisManager.ApplicationPools[ApplicationPool]; 
```}

This code fails and iisManager is always null.

Windows for business | Windows Server | User experience | Other
Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 84,086 Reputation points
    2024-10-28T20:05:55.8533333+00:00

    this is a rather obsolete library. you need to properly enable dcom on the remote server.

    https://mvolo.com/connecting-to-iis-70-configuration-remotely-with-microsoftwebadministration/

    a better approach is to use the IIS Rest API:

    https://learn.microsoft.com/en-us/iis-administration/

    Was this answer helpful?

    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.