locked
How to delete solution on moss 2007 farm remotely using powershell script? RRS feed

  • Question

  • Hi,

    I am writing the powershell script to add or delete solution remotely on moss 2007 but i am facing the  error object refernece not set for this...

    Code:

    [VOID] [System.Reflection.Assembly]::Load(“Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”)


     function Get-LocalFarm
    {
       return [Microsoft.SharePoint.administration.SPFarm]::Local
    }

    get-localfarm

    stsadm -o deletesolution -name legalusercertify


    Me
    • Edited by Mike Walsh FIN Tuesday, June 28, 2011 7:45 PM How to + ? not Need to which is pushy
    • Moved by Mike Walsh FIN Tuesday, June 28, 2011 7:46 PM not general (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
    Tuesday, June 28, 2011 5:58 AM

Answers

All replies

  • I have not tested this, but I am sure that there is a way to do this using PSSessions. Think there are cmdlts to execute. For Eg: "new-pssession" establishes a new session. "enter-pssession" to enter a remote session. Ultimately this might not be a silver bullet, but a try.

    Thursday, June 30, 2011 12:54 PM
  • Hi,

    I am getting this error:

    Object reference not set to an instance of an object.
        + CategoryInfo          : NotSpecified: (Object referenc...e of an object.:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError
     


    Me
    Friday, July 1, 2011 3:18 PM
  • Is there a reason why you can't use STSADM?

    I'm not sure of the answer myself yet but a good place to start may be reading this link.  I've not tried yet, so I can't vouch for how accurate it is: -

    http://patrickboom.wordpress.com/2010/05/31/using-powershell-to-deploy-sharepoint-solutions-wsp-2/


    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/
    Monday, July 4, 2011 7:39 AM
    Answerer