locked
Problem with run PowerShell Script RRS feed

  • Question

  • Hi, I fired the powerShell script on the farm solution (3 frontend and CA) as below:

    $assignment = Start-SPAssignment
    $web = Get-SPWeb -Identity "http://win-2mnvarm1eor/" -AssignmentCollection $assignment
    $rootFolder = $web.RootFolder
    $rootFolder.WelcomePage = "SitePages/Regulamin.aspx"
    $rootFolder.Update()
    Stop-SPAssignment $assignment

    but I've got Exeption:

    Exception settings "WelcomePage": "Access is denied. <Exception from HRESULT: 0x 80070005 <E_ACCESSDENIED>>"

    Hmm..Do you have any idea what can be a problem ? I run powershell as Administrator

    Thank you.


    • Edited by CaMeL023 Monday, October 3, 2011 4:39 PM
    Monday, October 3, 2011 4:38 PM

Answers

  • Try doing the action from the UI to see if you get an error or maybe can learn something about the process you're trying to automate.

    What user does SharePoint think PowerShell is?


    Steve Clark, MCTS | Twin-Soft.com
    • Marked as answer by Pengyu Zhao Friday, October 14, 2011 2:07 AM
    Monday, October 3, 2011 7:48 PM
  • When you mentioend that you ran it as administrator: do you mean machine administrator or site collection administrator?

    Because the error indicates that you don't have sufficient rights in SharePoint. A machine administrator is not necessarily a SharePoint admin.


    Stefan Goßner
    Senior Escalation Engineer - Microsoft CSS
    This post is provided "AS IS" with no warrenties and confers no rights.
    • Marked as answer by Pengyu Zhao Friday, October 14, 2011 2:07 AM
    Tuesday, October 4, 2011 9:38 AM

All replies

  • Try doing the action from the UI to see if you get an error or maybe can learn something about the process you're trying to automate.

    What user does SharePoint think PowerShell is?


    Steve Clark, MCTS | Twin-Soft.com
    • Marked as answer by Pengyu Zhao Friday, October 14, 2011 2:07 AM
    Monday, October 3, 2011 7:48 PM
  • Hi,

    Check if the welcome is checked out to someone else or not.

    I hope this will help you out.


    Thanks, Rahul Rashu
    Tuesday, October 4, 2011 4:31 AM
  • When you mentioend that you ran it as administrator: do you mean machine administrator or site collection administrator?

    Because the error indicates that you don't have sufficient rights in SharePoint. A machine administrator is not necessarily a SharePoint admin.


    Stefan Goßner
    Senior Escalation Engineer - Microsoft CSS
    This post is provided "AS IS" with no warrenties and confers no rights.
    • Marked as answer by Pengyu Zhao Friday, October 14, 2011 2:07 AM
    Tuesday, October 4, 2011 9:38 AM