none
Project Server 2013 powershell cmdlets RRS feed

  • Question

  • I am upgrading 2010 project server to 2013 in Test environment and the powershell is not taking any command like Set-SPsite for setting the Secondary owner alias ot Test-SPSite. It tested and mounted the content database fine through powershell. For SPSite it  gives message :The term 'Test-SPSite' is not recognized as the name of acmdlet, function, script file, or operable program. Check the spelling of thename, or if a path was included, verify that the path is correct and try again.

    I have tried add-pssnapin and all other such commands. Nothing works. Any suggestions?

    Not sure whether Upgrade-SPsite or other commands to load Project server database will work or not!!


    • Edited by geeam Tuesday, May 6, 2014 8:37 PM
    Tuesday, May 6, 2014 8:34 PM

Answers

  • Hello Geeam

    You musg first install SharePoint 2013 and Project Servrr 2013 before the powershell commands will work.  Then backup and restore SQL databases to new environment.

    Cheers


    Michael Wharton, MVP, MBA, PMP, MCT, MCTS, MCSD, MCSE+I, MCDBA
    Website http://www.WhartonComputer.com
    Blog http://MyProjectExpert.com contains my field notes and SQL queries

    • Marked as answer by geeam Thursday, May 8, 2014 4:19 AM
    Wednesday, May 7, 2014 12:22 AM
    Moderator

All replies

  • Hello Geeam

    You musg first install SharePoint 2013 and Project Servrr 2013 before the powershell commands will work.  Then backup and restore SQL databases to new environment.

    Cheers


    Michael Wharton, MVP, MBA, PMP, MCT, MCTS, MCSD, MCSE+I, MCDBA
    Website http://www.WhartonComputer.com
    Blog http://MyProjectExpert.com contains my field notes and SQL queries

    • Marked as answer by geeam Thursday, May 8, 2014 4:19 AM
    Wednesday, May 7, 2014 12:22 AM
    Moderator
  • SharePoint and Project server 2013 is already installed and the farm is created. The restore from 2010 content databse has worked fine and the content database mounted. Actually the powershell looks like working fine as on running the command get-spsite we get the error:

     

    get-SPSite : Cannot find an SPSite object with Id or Url:

    get-SPsite : ID4257: X.509 certificate 'CN=SharePoint Security Token Service,
    OU=SharePoint, O=Microsoft, C=US' validation failed by the token handler.
    At line:1 char:1
    + get-SPsite
    + ~~~~~~~~~~
        + CategoryInfo          : InvalidData: (Microsoft.Share...SPCmdletGetSite:
       SPCmdletGetSite) [Get-SPSite], SecurityTokenValidationException
        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetSite

    Get-SPWebApplication gave the correct web application created through Central Admin. The PWA site from the restored database can be seen in Application Management with correct URL.

    The new web application was made with default(claims based authentication) while the 2010 authentication method was Windows Classic.

    Any suggestions?


    • Edited by geeam Wednesday, May 7, 2014 4:42 AM
    Wednesday, May 7, 2014 4:33 AM
  • Just wanted to check if you are using Windows powershell or Sharepoint management Shell, please confirm

    To access the SharePoint Management Shell
    1.  

      Start the SharePoint Management Shell.

      • For Windows Server 2008 R2:

        • Click Start, click Microsoft SharePoint 2013 Products, and then click SharePoint Management Shell.

      • For Windows Server 2012:

        • On the Start screen, click SharePoint Management Shell.

          If SharePoint Management Shell is not on the Start screen:

        • Right-click Computer, click All apps, and then click SharePoint Management Shell.

    If it still doesn't works, try adding the sharepoint / project server snap in following this post http://blogs.msdn.com/b/kaevans/archive/2011/11/14/add-microsoft-sharepoint-powershell-snap-in-to-all-powershell-windows.aspx 


    Thanks | Sunil Kr Singh | http://epmxperts.wordpress.com

    Wednesday, May 7, 2014 4:47 PM
    Moderator
  • Also, when you start the powershell session, be sure to start as administrator.  Execute the following commands.

    Set-ExecutionPolicy "Unrestricted"

    Add-PSSnapin Microosft.SharePoint.PowerShell

    Make sure this is loaded and see if your PowerShell commands work.

    Cheers!


    Michael Wharton, MVP, MBA, PMP, MCT, MCTS, MCSD, MCSE+I, MCDBA
    Website http://www.WhartonComputer.com
    Blog http://MyProjectExpert.com contains my field notes and SQL queries

    Thursday, May 8, 2014 2:28 AM
    Moderator
  • Thanks for all your replies. It seems that PowerShell is working but it is the Security Token Certificate that is failing, as shown in the above message:

    ----

    get-SPsite : ID4257: X.509 certificate 'CN=SharePoint Security Token Service,
    OU=SharePoint, O=Microsoft, C=US' validation failed by the token handler.
    At line:1 char:1
    + get-SPsite
    + ~~~~~~~~~~
    + CategoryInfo : InvalidData: (Microsoft.Share...SPCmdletGetSite:
       SPCmdletGetSite) [Get-SPSite], SecurityTokenValidationException
        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetSite

    ----

    I checked the certificate is there and reloaded it to the Manage Trust section under Security in Central Admin but the  get-SPSite continues to give the same message.

    Do we need to start SharePoint Web Services for security token as the 2013 web application is made claims based which is the default?

    Any suggestions?


    • Edited by geeam Thursday, May 8, 2014 10:22 AM
    Thursday, May 8, 2014 4:02 AM