Friday, September 10, 2010

SharePoint 2010: How to add back QuickLaunch to the web part page.

Actually this is not adding but just removing hiding functionality:

1. Remove this code/css from the page

<SharePoint:UIVersionedContent ID="WebPartPageHideQLStyles" UIVersion="4" runat="server">
<ContentTemplate>
<style type="text/css">
body #s4-leftpanel {
display:none;
}
.s4-ca {
margin-left:0px;
}
</style>
</ContentTemplate>
</SharePoint:UIVersionedContent>


2. Remove this place holder from the page

<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>

Thursday, September 2, 2010

Restart SPTimerV4 service remotely in the SharePoint farm

There is a PowerShell script which restarts SPTimerV4 service remotely on every application server within a farm. This is useful when deployment of a SPTimerJob has been done.

It should be run on one of the application servers under SharePoint 2010 Management Shell, and you have to have enough permissions of course.

foreach ($server in (get-spserver | Where {$_.Role -eq "Application"}) )
{
write-host $server.Name
$service = Get-Service -computer $server.Name -name SPTimerV4
if ($service.Status -ne "Stopped")
{
$service.Stop()
Do
{
start-sleep -s 5 | out-null
write-host '.' -noNewLine
$service = Get-Service -computer $server.Name -name SPTimerV4
}
While ($service.Status -ne "Stopped")
write-host $service.Status
}
else
{
write-host "Stopped already"
}
if ($service.Status -ne "Running")
{
$service.Start()
Do
{
start-sleep -s 5 | out-null
write-host '.' -noNewLine
$service = Get-Service -computer $server.Name -name SPTimerV4
}
While ($service.Status -ne "Running")
write-host $service.Status
}
}

It shows the state of the service for each server. So, you can go and restart it manually if something was going wrong.