WebExtensions.GetAllWebUrls (PnP Core Component) – This extension method returns the collections of the URLs of all web sites that are contained within the site collection including the top-level site and its sub sites.
Syntax:
Single Line Code: Site.GetAllWebUrls()
Code Snippet:
The following example returns the collection of all web sites from the Site Collection including top level site and its sub site.
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.SharePoint.Client;
- using OfficeDevPnP.Core;
- // Assembly Reference Used: OfficeDevPnP.Core, Version=2.4.1605.0, Culture=neutral, PublicKeyToken=3751622786b357c2
- namespace SampleApplication
- {
- class Program
- {
- static void Main(string[] args)
- {
- string siteUrl = "https://sharepointonline.sharepoint.com";
- AuthenticationManager authManager = new AuthenticationManager();
- //Interactive Login to SharePoint site - Opens a Online signin page to authenticate the user
- var context = authManager.GetWebLoginClientContext(siteUrl);
- IEnumerable<string> webUrls= context.Site.GetAllWebUrls();
- string weburl = "";
- foreach(var url in webUrls)
- {
- weburl += url + "\r\n";
- }
- Console.WriteLine(weburl);
- Console.WriteLine("Press any key to exit.");
- Console.ReadKey();
- }
- }
- }


Naveen PrasathPosted Jan 16, 2019, 8:14 PM EST
Hi, Is it possible to use GetWebLoginClientContext in Azure web application? If No, what is the best way to get the clientcontext from Azure web app? Have to obtain the ClientContext within user context not an app only context? Please suggest an idea.
Vipin TyagiPosted Jul 27, 2016, 2:18 AM EDT
Yes,I want to discuss the core idea behind it and how I can be good in it.
Vipin TyagiPosted Jul 21, 2016, 2:20 AM EDT
Shantha Kumar T Sir,I want a discussion for PnP Core.How It is possible?
Bhuvanesh MohankumarPosted May 18, 2016, 3:43 AM EDT
Good one...
naveen kumarPosted May 17, 2016, 2:04 AM EDT
i think OfficeDevPnP.Core.AuthenticationManager authManager = new OfficeDevPnP.Core.AuthenticationManager(); is the solution
naveen kumarPosted May 17, 2016, 2:03 AM EDT
new AuthenticationManager() giving has no Constructor defined