0

How can I manage IIS remotely from another server using C #?

ServerManager.OpenRemote("ServerName");

I need an example of ServerName format in above snippet code

I tried this example with "localhost" parameter but did not return any value

  • This question is lacking. Put a server name in, What happens? My guess its not the name format at all, its everything else that can stop this from working – TheGeneral Feb 02 '21 at 08:19
  • it's not really clear what problem you have, but I guess you might find the right answer among these related Q/As: https://stackoverflow.com/search?q=ServerManager.OpenRemote+answers%3A1 – jps Feb 02 '21 at 08:33
  • var remote = ServerManager.OpenRemote("Test"); I tried this example with "localhost" parameter but did not return any value – Mohammadreza Feb 02 '21 at 08:48

1 Answers1

-2

You need to ensure that you have enough administration privilege to access the remote IIS, such as Firewall is disabled on both the server. The logon user is domain\administrator.

This link also provide some configuration to enable the DCOM:

Credentials for ServerManager.OpenRemote

samwu
  • 3,857
  • 3
  • 11
  • 25
  • "The logon user is domain\administrator" is rather misleading. – Lex Li Feb 02 '21 at 13:52
  • I tried this example with "localhost" parameter but did not return any value https://i.stack.imgur.com/TcSYE.jpg – Mohammadreza Feb 03 '21 at 06:31
  • @Mohammadreza Have you tried my above steps? – samwu Feb 04 '21 at 07:32
  • @samwu yes I did. But I didnt give eny result. Is it necessary to use any special config ? – Mohammadreza Feb 05 '21 at 09:43
  • To connect to the remote server, you need to be logged in as/impersonating the local Administrator account with a synchronized password on the remote server. how do you configure your server? – samwu Feb 09 '21 at 02:21