Monday, 24 October 2011

Turn off User Alerts in SharePoint 2010

Have you ever tried to turn off the 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, 18 March 2011

SharePoint 2010 Branding / Customisation

I will show you how to do some basic customisation on a SharePoint 2010 Publishing site, and then to make a few tweaks on the "CSS" file on the SharePoint page.

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.
That's it !!!

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 is how  the Customised SharePoint 2010 Site looks.....