using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Taxonomy;
namespace TaxonomyCodeSamples
{
class Program
{
static void Main(string[] args)
{
using
(SPSite site = new SPSite("http://c4968397007/"))
{
TaxonomySession taxSession = new TaxonomySession(site);
//// Get the term store
TermStore termStore =
taxSession.TermStores["MMS"];
//// Get the local site collection
taxonomy group
Group group =
termStore.GetSiteCollectionGroup(site);
//// Gets a list of URLs of site
collections that have read-only access.
ReadOnlyCollection<string> urls =
group.SiteCollectionReadOnlyAccessUrls;
foreach (string url in urls)
{
//// Display the site collection
URL that have read only access
Console.WriteLine(url);
}
Console.ReadLine();
}
}
}
}
|