locked
Unable to run powershell cmdlets SharePoint 2007 RRS feed

  • Question

  • PS C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN> [System.Reflection.Assembly]::Load(“Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”) 
    [System.Reflection.Assembly]::Load(“Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”)

    $site = get-spsite http://teams.com/sites/MonthEnd

    $site

    GAC    Version        Location                                                                                                                 
    ---    -------        --------                                                                                                                 
    True   v2.0.50727     C:\Windows\assembly\GAC_MSIL\Microsoft.SharePoint\12.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.dll                    
    True   v2.0.50727     C:\Windows\assembly\GAC_MSIL\Microsoft.SharePoint.Portal\12.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Portal.dll      
    The term 'get-spsite' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or
     if a path was included, verify that the path is correct and try again.
    At line:4 char:19
    + $site = get-spsite <<<<  http://teams.com/sites/MonthEnd
        + CategoryInfo          : ObjectNotFound: (get-spsite:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    Tuesday, September 26, 2017 4:39 PM

All replies

  • Hi Amol Pawar.

    SharePoint 2007 does not natively include PowerShell and the related cmdlets since the STSADM command was used to perform operations.
    Anyway, you could download and install PowerShell from http://support.microsoft.com/kb/968930 (if you're using Windows Server 2008 or higher, Windows PowerShell is natively supported) and then start using Windows PowerShell cmdlets to perform operations on your SharePoint 2007 farms: read here to know more about that.

    Bye.


    Luigi Bruno
    MCP, MCTS, MOS, MTA

    Tuesday, September 26, 2017 5:22 PM
  • Hi Luigi,

    I am aware of it but. I am able to run SharePoint cmdlets for SP 2007 on Windows Server 2008 SP2 machine. The above script.

    But When I am  running the same script for SP 2007 on Windows Server 2008 SP1 it is throwing above error. Is there any changes in SP1 and SP2 for Windows Server 2008 which can recognize the cmdlet

    S C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN> $site = Get-SPSite http://teams.com/sites/MonthEnd
    $site


    ApplicationRightsMask      : FullMask
    ID                         : d77e993a-e39c-41b2-bee9-8b4bc0a99ce3
    SystemAccount              : SHAREPOINT\system
    Owner                      : 
    SecondaryContact           : mossadmin
    GlobalPermMask             : FullMask
    IISAllowsAnonymous         : False
    Protocol                   : http:
    HostHeaderIsSiteName       : False
    HostName                   : teams.com
    Port                       : 80
    ServerRelativeUrl          : /sites/MonthEnd
    UpgradeRedirectUri         : 
    Zone                       : Default
    Url                        : http://teams.com/sites/MonthEnd
    Impersonating              : False
    Audit                      : Microsoft.SharePoint.SPAudit
    AllWebs                    : {Month End Processing, 2010, April, August...}
    Features                   : {a392da98-270b-4e85-9769-04c0fde267aa, f6924d36-2fa8-4f0b-b16d-06b7250180fa, e978b1a6-8de7-49d0-8600
                                 -09a250354e14, 2ed1c45e-a73b-4779-ae81-1524e4de467a...}
    PortalUrl                  : http://teams.com/
    PortalName                 : Team Sites
    LastContentModifiedDate    : 01/09/2017 11:44:26
    LastSecurityModifiedDate   : 14/08/2017 10:45:14
    CatchAccessDeniedException : False
    AllowUnsafeUpdates         : True
    UserToken                  : Microsoft.SharePoint.SPUserToken
    IsPaired                   : False
    SearchServiceInstance      : 
    WebApplication             : SPWebApplication Name=SharePoint - Collaboration Parent=SPWebService
    ContentDatabase            : SPContentDatabase Name=WSS_Content_Teams

    Parent=SPDatabaseServiceInstance
    Quota                      : Microsoft.SharePoint.Administration.SPQuota
    RootWeb                    : Month End Processing
    LockIssue                  : 
    Usage                      : Microsoft.SharePoint.SPSite+UsageInfo
    ReadLocked                 : False
    WriteLocked                : False
    ReadOnly                   : False
    WarningNotificationSent    : False
    UserAccountDirectoryPath   : 
    SyndicationEnabled         : True
    AllowRssFeeds              : True
    CertificationDate          : 24/02/2008 22:07:21
    DeadWebNotificationCount   : 0
    RecycleBin                 : {}
    ExternalBinaryIds          : {}
    CurrentChangeToken         : 1;1;d77e993a-e39c-41b2-bee9-8b4bc0a99ce3;636421895526030000;397033
    WorkflowManager            : Microsoft.SharePoint.Workflow.SPWorkflowManager

    But for SP2 I am getting the error am I missing something or I need to install SP2 and check

    Thursday, September 28, 2017 10:26 AM