Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve the list of sharepoint sites, user has access to , from a windows application

Tags:

c#

sharepoint

I need to retrieve a list of all the SharePoint sites to which I have access to via a windows application (C#). I am planning to use SharePoint web services.

Any pointers using SharePoint web services which could provide me the required information?

like image 619
Kapil Avatar asked Dec 18 '22 06:12

Kapil


1 Answers

If you want to use the API instead then I would suggest you do the following to return all the sub webs for the current user without having to use elevated priviliges.

using(SPSite site = new SPSite("http://example/site/"))
{
    using (SPWeb web = site.OpenWeb())
    {
        SPWebCollection webCollection = web.GetSubwebsForCurrentUser();
    }
}
like image 197
Michael Ciba Avatar answered Mar 23 '23 00:03

Michael Ciba