0

I have a SharePoint Farm with 25 servers. I was asked to build a new server out of the SharePoint to pull the information from SharePoint Farm and store in SQL Server in different server outside of the SharePoint Farm within the Same network. I will need to use to C# and SQL Server to pull the information from remote SharePoint Farm. I have already installed SharePoint in my local development box. How do I connect to remote SharePoint Farm with C#. I have the Farm Administrator User Credentials. How do I connect to the SharePoint Farm wihtout being in the actual Farm with C# or with PowerShell?

1
  • You should use SharePoint webservices. Dec 1, 2014 at 15:42

2 Answers 2

1

You should use Client Object Model (.NET Framework redistributable assemblies):

http://msdn.microsoft.com/en-us/library/office/fp179912(v=office.15).aspx

1

You need to reference SharePoint client DLLs into your remote VS project:

- C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.Client.dll
- C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.Client.Runtime.dll

(replace "14" by "15" in these paths if SP2013)

These DLLs are redistribuable (can be deployed with your Web site or exe) and can be used on a development machine without SharePoint installed.

Once these DLLs are referenced, you can write C# code to access/manage your remote SharePoint. Examples can be found in the MSDN, for instance, to read list items: http://msdn.microsoft.com/en-us/library/office/ee534956(v=office.14).aspx (SP 2010, same for SP2013).

Note: these client DLLs are wrappers around SP Web services and REST calls. So, a simple HTTP(S) connection is required between the client and SharePoint.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.