Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8999621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:12:16+00:00 2026-06-16T00:12:16+00:00

I am trying to read the status of a site using Servermanager. Basically this

  • 0

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 == Convert.ToInt64(siteInstance.IisIdentifier));
    return site.State.ToString();

I am able to read the config file and site details without any issue. But the status of the site is either giving me COM error below or giving an status that doesn’t reflect the actual status of the site in IIS.

The object identifier does not represent a valid object. (Exception from HRESULT: 0x800710D8)

To my understanding, config file only contains the site information. It doesn’t indicate which IIS servers are reading from the config. So how does the ServerManager know which IIS to look into to look for the running status of the site?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:12:16+00:00Added an answer on June 16, 2026 at 12:12 am

    The reason you are getting the site is because you are trying to read the status from site configuration file, which doesn’t contain the state of the site. Instead, what you should be doing is connect directly to IIS server like this:

    ServerManager manager= ServerManager.OpenRemote("testserver");
    var site = manager.Sites.First();
    var status = site.State.ToString() ;
    

    Please refer to my post below for full details:
    Programmatically get site status from IIS, gets back COM error

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to read all the status messages of a user. I have
I'm very new at JSON, I'm trying to read one parameter of this file
I'm trying to read in multiple files using MPI-IO in C. I'm following this
Trying to read an RSS and select information using Linq but can't seem to
I am trying to read in an XML file that I have saved to
I have been trying to read up on GCD and trying to figure it
I am trying to read from a file and encrypt the data using AES
I have read several articles/questions/forums discussing the best auto-complete plugin for jQuery. After trying
I'm trying to read the public twitter status of a user so I can
Firstly just a big Thanks to everyone on this site, I am using it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.