none
Project server sites list RRS feed

  • Question

  • Hi All,

    We have one requirement to generate the project server web application level sites list, for this we used below code.

    #Using this script getting Farm level sites information
      Get-SPWebApplication "Enter webapplication name"| Get-SPSite -Limit ALL | Get-SPWeb -Limit ALL |
      where { $_.HasUniquePerm -and $_.AssociatedOwnerGroup -ne $null } | 
      foreach { $Title=$_.title;$TTNweburl = $_.Url; $_ ;$SiteCreatedDate=$_.Created; $SiteModifiedDate=$_.LastItemModifiedDate}| 
      Select -ExpandProperty AssociatedOwnerGroup | 
      Select -ExpandProperty Users |
      Select {$Title},{$TTNweburl}, UserLogin, DisplayName, {$SiteCreatedDate.tostring(“MM-dd-yyyy”)}, {$SiteModifiedDate.tostring(“MM-dd-yyyy”)}|
      Export-Csv -Path  D:\Siteslist.csv -Force

    When we used above powershell script in the project server we are getting below error.

    Get-SPWebApplication : The term 'Get-SPWebApplication' 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 D:\Sites data\Siteslist.ps1:2 char:3
    +   Get-SPWebApplication http://projects| Get-SPSite -Limit ALL | Get-SPWeb -Limit ...
    +   ~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Get-SPWebApplication:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException

    Same script used in the SharePoint server 2013, it's working.

    Kindly tell us know where we need to change the script.


    Thanking You, Nagendra.

    Tuesday, May 28, 2019 6:37 AM

All replies

  • Hi Nagendra.

    Since the Get-SPWebApplication cmdlet is not recognized, try adding the below line at the beginning of the PowerShell script

    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

    Bye.


    Luigi Bruno
    MCP, MOS, MTA, MCTS, MCSA, MCSE

    Tuesday, May 28, 2019 1:49 PM
  • Hi Luigi,

    After adding Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue command, we are getting error.

     

    Get-SPWebApplication : Cannot access the local farm. Verify that the local farm is properly configured, currently avai

    lable, and that you have the appropriate permissions to access the database before trying again.

    At line:3 char:3

    +   Get-SPWebApplication "Enter webapplication name"| Get-SPSite -Limit ALL | Get- ...

    +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : InvalidData: (Microsoft.Share...tWebApplication:SpCmdletGetWebApplication) [Get-SPWebAp

       plication], SPCmdletException

        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SpCmdletGetWebApplication

       


    Wednesday, May 29, 2019 11:14 AM
  • Hi Luigi,

    After adding Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue command, we are getting error.

     

    Get-SPWebApplication : Cannot access the local farm. Verify that the local farm is properly configured, currently avai

    lable, and that you have the appropriate permissions to access the database before trying again.

    At line:3 char:3

    +   Get-SPWebApplication "Enter webapplication name"| Get-SPSite -Limit ALL | Get- ...

    +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : InvalidData: (Microsoft.Share...tWebApplication:SpCmdletGetWebApplication) [Get-SPWebAp

       plication], SPCmdletException

        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SpCmdletGetWebApplication

       


    Which PowerShell version are you using? If you're running Project Server 2010 (which runs upon SharePoint 2010), you need to user PowerShell version 2.0 for the SharePoint cmdlets to work.
    Open an administrative SharePoint PowerShell window, type $psVersionTable and hit ENTER: which is the output?
    Remember that those PowerShell cmdlets must be executed on the server where the Project Server service application has been provisioned.

    Bye.


    Luigi Bruno
    MCP, MOS, MTA, MCTS, MCSA, MCSE

    Wednesday, May 29, 2019 4:15 PM
  • You also must be on the server hosting PWA.

    Michael Wharton, Project MVP, MBA, PMP and a Great Guy <br/> Website http://www.WhartonComputer.com <br/> Blog http://MyProjectExpert.com contains my field notes and SQL queries

    Thursday, May 30, 2019 11:53 AM
    Moderator
  • Hi,

    When we start the SharePoint 2013 Management Shell as an Administrator getting below error.

    The local farm is not accessible. Cmdlets with FeatureDependencyid are not registered.


    Thanking You, Nagendra.

    Saturday, June 8, 2019 6:58 PM
  • Hi,

    When we start the SharePoint 2013 Management Shell as an Administrator getting below error.

    The local farm is not accessible. Cmdlets with FeatureDependencyid are not registered.


    Thanking You, Nagendra.

    Which are the permission against the farm for the account you're executing the SharePoint Management Shell under?
    Open the SharePoint Management Shell under an account who is a farm administrator and execute the Get-SPShellAdmin cmdlet to get the list of all the accounts who can execute PowerShell cmdlet against the SharePoint farm: it could be necessary to grant one or more accounts the SharePoint_Shell_Access role by executing the Add-SPShellAdmin cmdlet from an administrative SharePoint Management Shell.

    Bye.


    Luigi Bruno
    MCP, MOS, MTA, MCTS, MCSA, MCSE

    Saturday, June 8, 2019 7:31 PM
  • Hi Luigi,

    we were not aware of our farm account password and no where it got recorded, it we try resetting the password, will there be any issue in accessing or running project server site?


    Thanking You, Nagendra.

    Monday, June 10, 2019 11:08 AM
  • Hi Luigi,

    we were not aware of our farm account password and no where it got recorded, it we try resetting the password, will there be any issue in accessing or running project server site?


    Thanking You, Nagendra.

    The farm account is different from a farm administrator account: open the Central Administration site and go to Security > Manage the farm administrators group to get a list of the accounts who have been granted permission to be farm administrators.
    Anyway, you should keep track of the passwords used by the SharePoint accounts.

    Bye.


    Luigi Bruno
    MCP, MOS, MTA, MCTS, MCSA, MCSE

    Monday, June 10, 2019 1:57 PM
  • Hi Luigi,

    Already existed my account in the Farm administrator group, still we are getting same issue.


    Thanking You, Nagendra.

    Tuesday, June 11, 2019 9:06 AM
  • Hi Luigi,

    Already existed my account in the Farm administrator group, still we are getting same issue.


    Thanking You, Nagendra.

    Which SharePoint and Project Server versions are you using?
    Which PowerShell version are you running? Open an administrative SharePoint Management Shell, type $psVersionTable and hit ENTER: which is the output?

    Bye.


    Luigi Bruno MCP, MOS, MTA, MCTS, MCSA, MCSE


    Tuesday, June 11, 2019 12:46 PM
  • Run the SharePoint Products Configuration Wizard and see if it to the end and error free.

    Michael Wharton, Project MVP, MBA, PMP and a Great Guy <br/> Website http://www.WhartonComputer.com <br/> Blog http://MyProjectExpert.com contains my field notes and SQL queries

    Tuesday, June 11, 2019 1:45 PM
    Moderator
  • We are using SharePoint Server 2013, Project Professional 2013 and PS 3.0 versions.

    Thanking You, Nagendra.

    Tuesday, June 11, 2019 1:59 PM
  • Hi Luigi,

    Already existed my account in the Farm administrator group, still we are getting same issue.


    Thanking You, Nagendra.

    Open an administrative SharePoint Management Shell and execute the Get-SPShellAdmin cmdlet: is your account displayed in the output of the cmdlet?

    Bye.


    Luigi Bruno
    MCP, MOS, MTA, MCTS, MCSA, MCSE

    Wednesday, June 12, 2019 9:22 AM
  • Hi Luigi,

    We are getting below error.

    Get-SPShellAdmin : Object reference not set to an instance of an object.


    Thanking You, Nagendra.

    Wednesday, June 12, 2019 2:13 PM
  • Check with your Domain ADMIN.  There may be a group policy restricting use of PowerShell.

    Michael Wharton, Project MVP, MBA, PMP and a Great Guy <br/> Website http://www.WhartonComputer.com <br/> Blog http://MyProjectExpert.com contains my field notes and SQL queries

    Wednesday, June 19, 2019 8:28 PM
    Moderator