Created
February 4, 2015 11:21
-
-
Save wictorwilen/4f40541a78b54951ebb7 to your computer and use it in GitHub Desktop.
Reset SharePoint Cache on all servers in the farm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asnp microsoft.sharepoint.powershell | |
Get-SPServer | ?{$_.Role -eq "Application"} | %{ | |
Write-Host -ForegroundColor Green "Updating $_ ..." | |
Invoke-Command -ComputerName $_.Name { | |
Stop-Service SPTimerV4 | |
Stop-Service SPAdminV4 | |
Get-ChildItem $env:ALLUSERSPROFILE\Microsoft\SharePoint\Config | ?{$_.Name.Contains("-")} | Get-ChildItem | ?{$_.Extension -eq ".xml"} | Remove-Item | |
$ini = Get-ChildItem $env:ALLUSERSPROFILE\Microsoft\SharePoint\Config | ?{$_.Name.Contains("-")} | Get-ChildItem | ?{$_.Extension -eq ".ini"} | |
"1" | Set-Content $ini.FullName | |
Start-Service SPTimerV4 | |
Start-Service SPAdminV4 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment