Press "Enter" to skip to content

Uploading WSP files programmatically to remote SharePoint farms

I was researching the possibility to upload a WSP file remotely, without logon access to any SP servers on a farm.

This is possible with the SPFarm.Open method, as long as you have access to the database. Firewalls should also allow access.

I have created a simple solution to demonstrate this: go to this page and click Download

The code to achieve this is fairly simple:

SPFarm.Open
  1. string connString = txtConnectionString.Text;
  2.  
  3. SPFarm remoteFarm = SPFarm.Open(connString);
  4.  
  5. remoteFarm.Solutions.Add(txtWSPPath.Text);

Hope this helps!