using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Web.Administration;
namespace ConsoleApplication20
{
    class Program
    {
        static void Main(string[] args)
        {
            ServerManager manager = new ServerManager();
            foreach (var r in manager.Sites)
            {
                Console.WriteLine(r.Name);
            }
            Console.WriteLine("--------------------------------------");
            Console.WriteLine("Dispaly all the site which is started");
            ServerManager manager1 = new ServerManager();
            var result = from r in manager1.Sites
                         where r.State == ObjectState.Started
                         select r;
            foreach (var r1 in result)
            {
                Console.WriteLine(r1.Name);
            }
            Console.WriteLine("--------------------------------------");
            Console.WriteLine("Dispaly application running in perticular application pool");
            ServerManager manager2 = new ServerManager();
            var result2 = from r in manager2.Sites
                          from k in r.Applications
                          where k.ApplicationPoolName.Equals("SharePoint - 80", StringComparison.InvariantCultureIgnoreCase)
                          select r;
            foreach (var r2 in result2)
            {
                Console.WriteLine(r2.Name);
            }
            Console.ReadKey(true);
        }
    }
}
my sincere thanks to www.debugmode.net
Microsoft Power Platform, SharePoint, Azure, AWS, Google Cloud, DevOps, AI/ML
Subscribe to:
Post Comments (Atom)
Featured Post
Important links
Important Links Node Download: https://nodejs.org/en/download Nvm-Windows: https://github.com/coreybutler/nvm-windows?tab=readme-ov-fi...
Popular posts
- 
CAML:- --------- <Where> <IsNotNull> <FieldRef Name='ID' /> </IsNotNull> ...
- 
WebForm1.aspx:- ------------------------- <% @ Page Language ="C#" AutoEventWireup ="true" CodeBehind ="...
- 
This operation can be performed only on a computer that is joined to a server farm by users who have permissions in SQL Server to read from...
- 
Authorize Postman to access SharePoint 1. Register Add-In 2. Grant Permissions to Add-In 3. Generate the Access Token 4. Access th...
- 
CreateDocumentSet.aspx <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %> <%@ Import Namesp...
- 
Reading an excel file using HTML 5 and jQuery and save in SharePoint list Reference https://github.com/SheetJS/js-xlsx https://github.co...
- 
Read SharePoint list Items using REST API and ReactJS Step1: Create a "ReactDemo" list and list columns as shown below. ...
- 
Read excel data from document library saving as list items using CSOM in SharePoint. 1. Upload an excel file into Document library. This ...
- 
CAML Query filter between two dates Method 1:- </And><Geq><FieldRef Name='Created' /><Value Type='Date...
 
 
 
 
 
No comments:
Post a Comment