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
SharePoint, Azure, AWS, Google Cloud, DevOps, AI, ML
Subscribe to:
Post Comments (Atom)
Featured Post
Python
Python: Python : the Python interpreter Matplotlib : Python 2D plotting library ( https://matplotlib.org/ ) networkx : ...
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...
-
Reading an excel file using HTML 5 and jQuery and save in SharePoint list Reference https://github.com/SheetJS/js-xlsx https://github.co...
-
CAML Query filter between two dates Method 1:- </And><Geq><FieldRef Name='Created' /><Value Type='Date...
-
ListItemCollection as a DataTable in SharePoint 2013 using CSOM internal DataTable GetDataTableFromListItemCollection() { ...
-
VS2012-> file -> new project -> c# -> Office/SharePoint -> Apps -> Apps for SharePoint 2013 -> "clientPeoplePicke...
-
Read excel data from document library saving as list items using CSOM in SharePoint. 1. Upload an excel file into Document library. This ...
-
Read SharePoint list Items using REST API and ReactJS Step1: Create a "ReactDemo" list and list columns as shown below. ...
No comments:
Post a Comment