Wednesday, November 1, 2017

Content Deployment Nightmares

We recently updated all 3 of our SharePoint farms, dev, prod, and our dmz servers with the August 2017 CU and then found out our content deployment jobs were failing to two of our forward facing SharePoint farms. The only thing that seemed to get the deployment jobs to stop running was to log on to each of my remote SharePoint servers and using powershell to stop the owstimer process. Once this was done the content deployment jobs would report back they had completed successfully but no content was actually deployed. We opened a ticket with Microsoft to get some assistance with the issue but we were still coming up short. Knowing that there was a process or timer job that wasn't firing like it was supposed to I ran this script and all of the sudden the content jobs started working properly.

$farm = Get-SPFarm

$disabledTimers = $farm.TimerService.Instances | where {$_.Status -ne "Online"}
if ($disabledTimers -ne $null)
{
foreach ($timer in $disabledTimers)
{
    $timer.Provision()
    $timer.Start()
    }
}

Wednesday, March 8, 2017

Powershell & SharePoint Exception has been thrown by the target of an invocation

The other day I was logged into my SharePoint server with my local admin user account and tried to run a powershell script against my farm and got an error that had me scratching my head. The error was "Exception has been thrown by the target of an invocation"

The error really made no sense since I had admin rights to the farm, but upon further investigation I found that my account didn't have the rights it needed to access some sites.

Solution was to go to central admin and select
 Application Management > Manage Web Applications >Select the web app you need access to >From the Ribbon select User Policy>Add Users

Here I added my account with Full Control and clicked save and then ran my powershell script again and it successfully executed.