Archive for the ‘SharePoint’ Category

Clear Sharepoint Cache

After learning to clean the sharepoint cache hardway, I have come up with basic commands, that would help all of who needs to get this done in easier way, below is the script, you can cut and paste it on to a notepad, save the file as clearSPCache.bat file and place it on the sharepoint server, when you execute the file, it will clean the sharepoint cache for you with one click. (assuming your sharepoint is installed in default locations as per microsoft).

========Script Start below===================

cd “%APPDATA%\Microsoft\Web Server Extensions\Cache”

del *.web /S /Q “%APPDATA%\Microsoft\Web Server Extensions\Cache”

cd “%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache\”

rmdir /S /Q “%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache\.”

mkdir “%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache”

dir “%APPDATA%\Microsoft\Web Server Extensions\Cache”
dir “%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache”


========Script End========================


Change Favicon in SharePoint 2010

The easiest way to change your favicon in SharePoint is to replace the default one with your own.

You can find this, among many other default files, here:

\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\


Hide ribbon for Visitors – Using Javascript

This requires you to modify your masterpage just a bit. It's minimal.

In your masterpage, find id="s4-ribbonrow" and add this to it:


Then add this after where that div ends

<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="FullMask">
<script type="text/javascript">
document.getElementById("s4-ribbonrow").style.display = "block";

Your result should be something like this:

<div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle" style="display:none;">
<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="FullMask">
<script type="text/javascript">
document.getElementById("s4-ribbonrow").style.display = "block";

This will only allow users with Full Control to see the Ribbon.


Hiding View All Site Content and Recycle Bin in SharePoint 2010

Look for the following element in the MasterPage code:

<SharePoint:UIVersionedContent UIVersion="4" runat="server" id="PlaceHolderQuickLaunchBottomV4">
<ul class="s4-specialNavLinkList">

Above the bold section, add the following line of code:

<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ManagePermissions">

Change the blue PermissionsString value to whatever you want. Multiple permissions can be separated with a comma (no spaces). Note it should be a permission your target user(s) do not have, and has to come from this list. Spelling and case-sensitivity is important. Finally, add the closing tag after the SharePoint:UIVersionedContent closing tag:



SharePoint 2010 returns a 503-Service Unavailable HTTP status

An issue I had was the application was stopped and even if I started it, it would stop directly after trying to load the web application.

A domain policy change had impacted the service account running the application pool.

And even though my service account was a local admin on the sharepoint host, I was not able to change my local security policies (secpol.msc).

After some back and forth with the domain admin, including the service account in a security group which had "log on as a batch job" rights resolved the issue.

In short, it may be the case that a domain group policy overrides an essential permission of the application pool accounts called “Log on as a batch job”. Without this permission, the application pool account is not able to run the application pool.

This is the article that finally got me on the path to a fix:

Return top