Monday, October 24, 2011
Turn off User Alerts in SharePoint 2010
It would be easy to set up a user alert in SharePoint 2010 list however when someone comes back to you and say "Hey its bugging me with the alert mails as am getting 15, 20 mails everyday" you would say "No worries I can fix it" and then you would go back to the list searching how you can do this and then you realise "What?? I can't do it" and by that time you would have added 100 users to the list :S
-Yes you need either Control point or Powershell script to turn it off as SharePoint 2010 does not allow you to turn off all the alerts for the users at a time until unless each user logs in and modify it.
I ran into the same situation :D and finally have to get some Powershell script to turn it off.
This would be usefull to you :
++++++++//Script // +++++++++
Start-SPAssignment –Global
$web = Get-SPWeb "***URL of Site***"
$listurl = "***Relative URL of List***"
$IDS = ""
$alertCount = 0
foreach($alert in $web.Alerts)
{
if($alert.ListUrl -eq $ListUrl)
{
$alertCount = $alertCount + 1
Write-Host "Alerts Title :" $alert.title
$IDS += $alert.ID.tostring() + "|"
}
}
Write-Host "Number Of Alerts in List :" $listurl "=" $alertCount
Write-Host "Deleting... "
foreach($s in $IDS.Split("|"))
{
write-host -nonewline "*"
if($s –ne "")
{
$web.alerts.delete([GUID]$s)
}
}
$alertCount = 0
foreach($alert in $web.Alerts)
{
if($alert.ListUrl -eq $ListUrl)
{
$alertCount = $alertCount + 1
Write-Host "Alerts Title :" $alert.title
}
}
Write-Host "Number Of Alerts after REMOVAL in List :" $listurl "=" $alertCount
Stop-SPAssignment –Global
+++++++++++++++++++++++++++++++++++++++++
Friday, March 18, 2011
SharePoint 2010 Branding / Customisation
I have created a simple Sharepoint 2010 Publishing site and have used SharePoint Designer 2010 to edit the Master Page and create a simple Top banner and make a slight change on the Quick launch menu, adding some simple image and links on the left side.I will detail this out over here so that you can start experimenting.
Primiarily i used Sharepoint 2010 Designer for this and its freely downloadable as you know :
Lets go step by step :
Step 1
Once you created a site with the "Publishing Template" you can also verify your Master Page by going to the SP 2010 site and Go to Site Action > Site Settings > Look and Feel > Master PageHere you can see SP 2010 by default use "Nightandday.master" page as the default Master Page.
Step 2
The Css file associated with this Master page is "nightandday.css" This resides in the Sitecollection Level Click on "All Files" in the SPDesigner > Style Library > en-US > Themable > Core Styles > Nightandday.css
Step 3
Open the site in SharePoint Designer On the left menu of the SP Designer you can see all the contents which exist on the Site You can click on the "Master Pages" which would open you and show all the master pages which exist on the site.
(You can also Click on "All files" > _catalogs > MasterPage for the same task)
Step 4
Since i have used the "SharePoint 2010" Publishing layout the deafult master page is
"NIghtandday.master", Righclick make a copy of that and rename it to "MyCustom.Master"
Step 5
By editing the css file you will be able to make all necessary changes which will be reflected on the
Master Page. Make a copy of the Css file and change it to "MyCustomCss.css" file

Step 6
All the images associated with this template lies in :Root Site > Style Library > Images folder
Step 7
There is an entry ".nightand day.ribbonbackground" property and if you change the "background-image:url " you can customise the topbanner image. Make sure you are uploading the topbanner image to the appropriate "Image library" as said in step 6

Step 8
You can also tweak a bit on the ".ms-quicklaunch" properties if you want to make changes in the quick launch menu

Step 9
Once you have made necessary changes in the css file you can edit the "MyCustom.master" master page and update the link to the CSS file.

Step 10
Go to SiteSettings > Master Page > and set the appropriate Master Page in the "Site Master Page " and "System Master Page" option, also set the New Css file.
Now if you go to your Sharepoint 2010 site you can see the topbanner and the changes you made on the Css files will be reflected.

There you go ........... This the Customised SharePoint 2010 Site
Thursday, August 5, 2010
SharePoint 2010 Multilingual Interface (Hindi)
I was testing the Multilingual Interface of SharePoint 2010; Seems SharePoint 2010 is improved and extended its capabilities on the good old MOSS 2007.
Both SharePoint foundation 2010 and SharePoint Server 2010 have language packs are avaialble to install, but if you are using licenced version of SharePoint Server 2010 you need to install both the SharePoint Foundation and the SharePoint Server langauage packs. I downloded the Hindi Language pack and installed - http://www.microsoft.com/downloads/details.aspx?FamilyID=046f16a9-4bce-4149-8679-223755560d54&displaylang=en
Once you install the language packs you can take advantage of Multilingual User Interface (MUI). The lanaguage is enabled on per-site basis Administration > Language settings will list out all the languages you installed.

SharePoint 2010 has done a pretty descent job in multi language implementation – List/ Document libraries column title that are pre-built into a list are automatically translated, however you can translate custom coloumns and engage metadata service application for further translation.

Sunday, April 18, 2010
How to Use CAML Query to get Data from SharePoint 2007 List
I was enjoying my summer with some CAML queries – All I wanted was to get some data from a simple Products List in SharePoint 2007. The list was pretty simple with 2 colomns "Product" and "Cost". I used U2U to create a pretty descent CAML query. I created a simple website in VS2008 to test it !!! It all worked fantastically!!!
Here is my Quick Dirty code –
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SharePoint;
namespace WebApplication1
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SPList mylist=new SPSite ("http://sharepointlogics").OpenWeb ().Lists ["Products"];
SPQuery query=new SPQuery ();
query.Query = "
SPListItemCollection items=mylist.GetItems (query);
foreach (SPListItem proditem in items )
{
Response.Write(proditem["Title"].ToString ());
Response.Write(proditem["Cost"]);
}
}
}
}
Hope you would enjoy it !!!!
Friday, March 26, 2010
Total Count of Items in a List in Sharepoint 2007
I had a recent assignment to test the performance of a List. The list was behaving really slow and I need to determine the total number of items in the list.
Aaaah ………… there starts the problem. I wanted the total number of items in the list and I could only do that by navigating through the List Item pages which was around 20,000 + Items, So need to click through every single pages and it would take couple of months to figure out the exact numbers. Then I thought about the "Calculated Columns" in Sharepoint.
Finally I figured out to get the total count of the Items in a Sharepoint List. Here are the steps -
Step 1.
Create a "Calculated (calculation based on other columns) " column in the List
Step 2.
Column Name - "Total"
The Type of Information in this column - "Calculated"
In the Formula Column put - "=SUM(ID)" (without apostrophise)
Select "The data type returned from this formula is: " as Number
Step 3.
Select "OK" - a new column will be added to the List and then you could see the Column "Total" which would display values from 1 to End number in ascending order. If you click the header "Total" the list would be displayed in descending order displaying the Total number of the Items in the list.
Tuesday, March 9, 2010
Sharepoint Service Pack 2 Release
Sharepoint 2007 Service Pack 2 Release(MOSS SP2)
I got a new task assigned to upgrade my MOSS Farm from SP1 to SP2.
Here are the steps which I done
Step 1
Installed Service Pack 2 for Windows SharePoint Services 3.0, x86 & x64
http://www.microsoft.com/downloads/details.aspx?FamilyId=79BADA82-C13F-44C1-BDC1-D0447337051B&displaylang=en
Step 2
Installed Service Pack 2 for Office SharePoint Server 2007, x86 & x64
http://www.microsoft.com/downloads/details.aspx?FamilyId=B7816D90
Once after the upgrade checkpoints -
Check 1
Go to the Control Panel>Add remove programs > Select "Microsoft Office Sharepoint Server 2007" > Click here for Support Information. This would be updated to 12.0.6425.1000
Check 2
Possible Errors
Strangely I was getting the below error while installing "Service Pack 2 for Office SharePoint Server 2007" Installer -
Event Type: Error
Event Source: MsiInstaller
Event Category: None
Event ID: 1023
Date: 08/03/2010
Time: 18:27:26
User: *****\Administrator
Computer: ******
Description:
The description for Event ID ( 1023 ) in Source ( MsiInstaller ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Microsoft Search Front End, 2007 Microsoft Office System Servers Service Pack 2 (SP2), 1603, C:\DOCUME~1\ADMINI~1.APP\LOCALS~1\Temp\coreserverwwsp2_MSPLOG.LOG, (NULL), , .
Creating a bit more space (1 GB) and rerunning the Installer fixed the issue, So a quick check would be on your C: drive space before you install the Service packs.
Known Error Lists Once after SP2 Release
http://www.wictorwilen.se/Post/SharePoint-Service-Pack-2-known-found-and-experienced-problems.aspx
Tuesday, March 2, 2010
Creating SharePoint 2007 Timer Jobs
http://www.andrewconnell.com/blog/archive/2007/01/10/5704.aspx
http://www.andrewconnell.com/blog/archive/2008/04/15/More-help-on-creating-custom-timer-jobs-and-a-useful.aspx


