SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can i deploy a wsp using powershell batch file without logging to the sp server ?

share|improve this question
up vote 1 down vote accepted

Have you tried the Remote PowerShell ability. Powershell 2.0 uses the concepts of WIN-RM which involves piping the contents of the remote call and running it on the remote server.

You need to setup the remote Computer 1st

  • you need to run the following command on your server Enable-PSRemoting
  • you need to let powershell know that your server machine or remote machine will act as the server. Enable-WSmanCredSSP -Role Server

Now Setup the Client Computer:

  • edit group policy on your client computer to all credential delegation
  • run the following command Enable-PSRemoting
  • enable WSMan CredSSP with the following command Enable-WSManCredSSP -Role Client –DelegateComputer “NameOfServer”

Now you can your powershell remotely. check the complete details over here

There is another possible way is with the SPFarm.Open method, as long as you have access to the database.

string connString = txtConnectionString.Text;

SPFarm remoteFarm = SPFarm.Open(connString);


check this link as well.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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