Step 1: Create web application class to store details about web application like name, owner details.
- public class WebApplication
- {
- public string Name { get; set; }
- public string Value { get; set; }
- public List<NameValuePair> SiteCollections { get; set; }
- public string Owner { get; set; }
- public string Name_Owner
- {
- get
- {
- return string.Format("{0} ({1})", this.Name, this.Owner);
- }
- }
- public WebApplication()
- {
- this.Name = this.Value = string.Empty;
- this.SiteCollections = new List<NameValuePair>();
- }
- public WebApplication(string name)
- : this()
- {
- this.Name = this.Value = name;
- }
- public WebApplication(string name, string value)
- : this()
- {
- this.Name = name;
- this.Value = value;
- }
- }
Step 2: C# code to find All Web Applications.

Join the conversation! Your thoughts help the community grow.