'Starting another web application from another - Control Panel

How can I start a web application from another web application, basically I'm trying to make my own internal website control panel which can start, stop and restart my other websites. What is the best way to do this?



Solution 1:[1]

If you're using IIS you can use the servermanager under Microsoft.Web.Administration.

https://docs.microsoft.com/en-us/iis/manage/scripting/how-to-use-microsoftwebadministration

Starting/Stopping a site would look something like:

var IISServer = new Microsoft.Web.Administration.ServerManager();
IISServer.Sites["FooSite"].Start();
IISServer.Sites["FooSite"].Stop();
IISServer.Sites["FooSite"].Start();

You can also get at most other aspects managed through IIS UI and do things like recycle app pools, change settings etc.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JustAnotherDev