Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to obtain SPSite for remote server from URL, username and password?

Tags:

c#

sharepoint

I'm trying to get an SPSite for a remote SharePoint URL:

SPSite site = new SPSite("http://remoteserver");

...but I get an exception. The is no problem when i try to connect to sharepoint on the local machine.

I have the required username and password of the remote server. Is there a way to get the SPSite with the username and password?

like image 288
CoffeeCode Avatar asked Nov 12 '09 22:11

CoffeeCode


1 Answers

You cannot do this from a remote machine. You will have to either be running that code on the SharePoint server machine, or interact with the remote server via the SharePoint web services that are exposed.

Can you be more specific about what you want to do with the SPSite once you get it? This may make it easier to make a judgment about which techniques are more appropriate for you.


Since you say you want to interact with lists on this remote site, I suggest you look into the Lists web service that comes with SharePoint 2007 and WSS 3. This SO question is similar, and there's a link to some resources there:

How do I update a sharepoint list using .net?

like image 173
Chris Farmer Avatar answered Oct 20 '22 05:10

Chris Farmer