locked
Remote Powershell For Non Farm Admins RRS feed

  • Question

  • We have a group of users that want to utilize remote power shell to update a list in SharePoint.  These users are not Farm admins and I would like to keep it that way if possible.  I have setup the rights for them to remote PowerShell to the box and they can load the command-lets but are getting the error when trying to run 

    $web = Get-SPWeb http://teams.company.com/sites/home

    Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again.

     

    I have found this information on the web but am weary of giving any rights to the config db.

    $dbs = Get-SPDatabase; foreach($d in $dbs) {If($d.name.contains("SharePoint_Config")){Add-SPShellAdmin "domain\USER" -database $d}}

     

    If you have had this issue I would greatly appreciate any feedback.

    Also these are the commands they will be running.  I am thinking that only rights to the site at this point will be needed which they have.

    #Get the Contacts List

    $List = $web.Lists["Contacts"]

    #Get All Items by update its title

    $ListItems = $List.items

     

    #Iterate through each item

    foreach($Item in $ListItems)

    {

        #Update the value of the "Title" column

        $item["Title"] = "Title Updated!"

     

        #Update the item

        $item.Update()

    }

     

     


    Tuesday, December 19, 2017 9:07 PM

Answers

All replies