Sharepoint 2010 client object module receiving the URL of the website URL

I am trying to learn the object model of a SharePoint client, in particular, how to get a list of all the URLs of SharePoint sites using a remote connection. This is possible using webservices ... but I want to do this using the client object model.

I figured out how to get the header lists of a particular sharepoint site using the following code:

client object module): ClientContext ctx = new ClientContext( server ); ctx.AuthenticationMode = ClientAuthenticationMode.Default; ctx.Credentials = WindowsAuthenticationCredentials(username, password); Web w = ctx.Web; var lists = ctx.LoadQuery(w.Lists); ctx.ExecuteQuery(); //Enumerate the results. foreach (List theList in lists) { } 

Output:

Announcements, Pages of the main collection ... etc.

How can I do the same to get a list of website urls?

In web services, you can call the following to achieve this, but, as I said, it’s just trying to figure out how to do the same with the client object module. If you can provide a C # code that would be much appreciated.

 WSPSitedata.SiteData sitedata = new SiteData(); sitedata.Url = @SharePointBaseURL + @"_vti_bin/sitedata.asmx"; sitedata.Credentials = our_credentials _sSiteMetadata metaData = new _sSiteMetadata(); _sWebWithTime[] webWithTime sitedata.GetSite(out metaData, out webWithTime, out users, out groups, out vgroups); 
+4
source share
1 answer

The SharePoint Client CSOM object model is designed to remotely interact with your SiteCollection. Of course, you can connect to various SiteCollections, but you cannot view all SiteCollections sitting in SPWebApplications.

In 2010, you can still use ASMX WebServices, which are available in earlier versions of SharePoint.

To better understand CSOM, you should take a look at the MSDN website http://msdn.microsoft.com/en-us/library/ee537247.aspx

Did you really mean a list containing all the SiteCollection URLs, or was it a misunderstanding?

Thorsten

+1
source

Source: https://habr.com/ru/post/1383514/


All Articles