Quantcast
Channel: General
Viewing all articles
Browse latest Browse all 7363

IIS 8 Access Denied to Stop App Pools

$
0
0

I have an application that deploys code to various target servers. Recently Windows 2012 servers have been added as target servers but the application's agent service returns an 'Access denied' message when trying to perform any tasks linked to IIS. For example the application will try to Stop the relevant App Pools and Sites before copying the code to the target. First thing the App does when trying to stop the App Pool is determine which app pool needs to be stopped:

private DirectoryEntry FindSite(int nPort)
    {
        using (DirectoryEntry sites = new DirectoryEntry(string.Format(m_adSitesPath, m_RemoteServerName)))
        {
            sites.RefreshCache();

            foreach (DirectoryEntry de in sites.Children)
            {
                de.RefreshCache();
                if (de.SchemaClassName == "IIsWebServer")
                {
                    string port = GetNullableDirMultiValuePart(de, "ServerBindings", 0, 1);
                    if (nPort == int.Parse(port))
                    {
                        return de;
                    }
                }
            }
        }
        return null;
    }

App fails after using (DirectoryEntry sites... with Access Denied. On the actual server the ID the Agent is logged in as is in the Admin group and has the Log on as a Service privilege set. This application does not display this issue when running on Windows 2008 servers with IIS7. Has anyone any advice on where I could start investigating? I have enabled IIS 6 Compatibility role service and Access is still denied, It appears to be permissions related but the ID setup matching on both servers is there something with IIS8 that I need to do or can do?

Thanks


Viewing all articles
Browse latest Browse all 7363

Latest Images

Trending Articles



Latest Images