Questions tagged [servermanager]
93 questions
3
votes
1 answer
Programmatically creating a remote site in IIS7 using Microsoft.Web.Administration: Invalid index. (Exception from HRESULT: 0x80070585)
I'm trying to write a provisioning tool for our web application. I am attempting to create a web site remotely in IIS7.5 using Microsoft.Web.Administration.ServerManager.
CODE:
using (ServerManager serverManager =…

Jean Lord
- 71
- 4
3
votes
3 answers
how check if port is currently used with IIS7 (webSite) in code behind?
I developed a program "installer" that will add and configure a new website on IIS.
My problem is that I want to check if the port given by the user is already used by another site before installing.
My project is in C # WinForm style.
Someone you…

Mehdi Bugnard
- 3,889
- 4
- 45
- 86
3
votes
2 answers
How does ServerManager finds the states of an given site
I am trying to read the status of a site using Servermanager. Basically this is what I have,
var serverManager = new ServerManager(siteInstance.Server.ConfigPath);
var site = serverManager.Sites.FirstOrDefault(x => x.Id ==…

jack
- 33
- 4
3
votes
1 answer
Why does the IIS ServerManager class create my handler mapping disabled?
I want to add a handler mapping (script map) for our custom CGI-Exe to an Internet Information Server using the classes in the Microsoft.Web.Administration namespace.
The (simplified) code is:
var serverManager =…

stefan.s
- 3,489
- 2
- 30
- 44
2
votes
1 answer
Validating virtual directory UNC Connection
I need to validate that the UNC connection credentials are valid and pass through authentication, for each virtual directory.
I'm using Microsoft.Web.Administration API to manage my IIS configurations.
The API does exposes the Username and password…

MichaelS
- 7,023
- 10
- 51
- 75
2
votes
1 answer
How to get the ApplicationPool object based on a Site in IIS
I've created an application that gets all of my Sites in IIS and checking each URL in Bindings if there's an HTTP error and if a certain error is encountered, my application will reset the IIS Site Instance in IIS, however, it's not enough to fix…

SpiderW3B
- 43
- 9
2
votes
0 answers
ServerManager not finding the correct Webserver
Im using Microsoft.web.administration class to find all sites in IIS. It executes without any issue, but returning sites from another webserver. I guess its IIS express on my PC as part of VS. So how to specify my default webserver where the sites…

Sandeep Thomas
- 4,303
- 14
- 61
- 132
2
votes
0 answers
Detecting what Server Roles are installed on Windows Server 2012/2016
I am developing an MFC C++ application and I need to detect which server roles have been installed for Windows Server 2012 and later.
In Windows Server 2008 the Win32_ServerFeature class could be used. Win32_ServerFeature
For Server 2012 there is…

Allan B.
- 33
- 8
2
votes
2 answers
Controlling a minecraft server with python
I've searched a lot for this and have not yet found a definitive solution. The closest thing I've found is this:
import shutil
from os.path import join
import os
import time
import sys
minecraft_dir = ('server diectory')
world_dir = ('server world…

H. Siddons
- 33
- 1
- 1
- 5
2
votes
2 answers
How to Allow IIS Manager User to a IIS Site using ServerManager Programatically
I would like to Allow the Existing IIS Manager User to a IIS Site or Website Using C# .
anyone can share the sample code . It would be really helpful .
Look at the image I want to add those users programmatically .
Thank You,
Jaswanth

Jaswanth Krishna
- 21
- 3
2
votes
0 answers
Application start called each time page is refreshed when config is changed in application_start
I want to update web.config just once when application is started. For this I thought I can use application_start method in Global.asax. While application_start is called only once normally when the first request is made to website, it is being…

tubakaya
- 457
- 4
- 15
2
votes
1 answer
Can I use ServerManager from Microsoft.Web.Administration without admin user as an application pool identity
I want to read some settings of the application pool using the ServerManager object from the Microsoft.Web.Administration.dll. The problem is that it works only if the identity of the application pool is a windows user with administrator privileges.…

Ivan Eftimov
- 228
- 1
- 10
2
votes
2 answers
Where can I find a list of exit codes and their meanings for the PowerShell ServerManager cmdlet?
I'm using the PowerShell ServerManager cmdlet and haven't been able to find a comprehensive list of exit codes for the installation commands.
$feature = Add-WindowsFeature NET-Framework-Core
exit $feature.ExitCode
What values can I expect ExitCode…

vmrob
- 2,966
- 29
- 40
2
votes
1 answer
Resolve 'configuration object is read only, because it has been committed by a call to ServerManager.CommitChanges()'?
I've written a custom action for an installer project that does the following:
Checks existing websites to see if any exist with the same name put
in by the user.
Creates the website in IIS if it doesn't exist.
Creates an application pool.
Assigns…

sr28
- 4,728
- 5
- 36
- 67
2
votes
1 answer
How do I check if Metadata exists with ServerManager?
I use the following code to get metadata with Microsoft.Web.Administration.ServerManager:
var manager = new ServerManager();
var site = manager.Sites["siteName"];
var metadata = site.GetMetadata("metaKey");
Now, if "metaKey" is not there, the…

Adrian Rosca
- 6,922
- 9
- 40
- 57