Friday, 13 September 2013

Change login name in SharePoint

Change default welcome control in SharePoint master page

Default welcome login control ( domain\your name)  change to "Welcome, first name last name" in SharePoint master page.

Add the below code in the master page:-


Tuesday, 20 August 2013

Hide the Column header in List View Web Part in SharePoint

Using CSS, Hide the Column header in List View Web Part

Add a Content Editor Web part  on the Page. Add following HTML under Source Editor :
style>
.ms-viewheadertr { display: none;}
/style>
Also, set Layout as "Hidden" for Content Editor.
This will hide the column  headers.

Tuesday, 13 August 2013

SharePoint Discussion Board Customization with Data View Web Part

User want to customization in SharePoint Discussion Board using SharePoint Designer like the below image:-
For that you should maintain two column: -
      -- Name: [like-Test_01] with Hyperlink the item.
      -- Limited Body: [like-Test by Rintu Mondal].
      -- Add Comment : For add the new comment in discussion board.

Following are the steps for creating the discussion board:-
1. Add one Empty Data View Web Part in a page.
2. Select data source with two column (Name and Limited Body).
3. Change code just
     
 Add Comment for herf= "../../..{@FileDirRef}/NewForm.aspx?Source={@FileRef}&ContentTypeId=0x0107&DiscussionParentID={@ID}"

4. save ok

Wednesday, 7 August 2013

Delete SharePoint Custom Group Using PowerShell

Delete SharePoint Custom Group Using Power Sell Scirpt

Deleted SharePoint custom group names are fetching from Excel sheet.
 - In Excel shell there is one column name is "Name".
Following is the power shell script code:
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

$count = 0
$contentWebAppServices = (Get-SPFarm).services |? {$_.typename -eq "Microsoft SharePoint Foundation Web Application"}
foreach($webApp in $contentWebAppServices.WebApplications)
{
    write-host "Site Collections"
    write-host ""
    foreach ($site in $webApp.Sites) 
    {
        $count++
        write-host "Site Collections URL --> -->" $site.URL
           write-host ""
           write-host "SubSites"
           write-host ""
          
           if($site.AllWebs -ne 'null')
           {
              foreach ($web in $site.AllWebs)
            {
                $count++
                write-host "SubSite URL --> --> -->" $web.URL
                write-host ""

      
               $spGroups = $Web.SiteGroups
               for ($index = 0; $index -lt $spGroups.Count; $index++)
               {
                write-Host "groupname" $spGroups[$index].Name
                $SharePointGroupName= import-csv "C:\Users\test1\Desktop\PowerShell Script\SharePointListName.csv"
                        $SharePointGroupName|ForEach-Object{
                                $groupname=$_.'NAME'
                if ($spGroups[$index].Name -eq $groupname )
                {
                     $spGroups.Remove($groupname)
                           Write-Host $groupname
                             $spweb.Update();
                        }
                   }
               }
            }
        }
    }
}
write-host "Total Count :" $count


Delete SharePoint List Using Powershell

Delete SharePoint List using Power shell Script

Deleted SharePoint list names are fetching from Excel sheet.
 - In Excel shell there is one column name is "Name".

 Following is the power shell script code

if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
$count = 0
$contentWebAppServices = (Get-SPFarm).services |? {$_.typename -eq "Microsoft SharePoint Foundation Web Application"}
foreach($webApp in $contentWebAppServices.WebApplications)
{
    write-host "Site Collections"
    write-host ""
    foreach ($site in $webApp.Sites)
    {
       $count++
       write-host "Site Collections URL --> -->" $site.URL
       write-host ""
       write-host "SubSites"
       write-host ""
       if($site.AllWebs -ne 'null')
       {
     foreach ($web in $site.AllWebs)
       {
           $count++
       write-host "SubSite URL --> --> -->" $web.URL
       write-host ""
       $lists = $web.Lists
           for ($index = 0; $index -lt $lists.Count; $index++)
       {
               $SharePointListName= import-csv "C:\Users\test1\Desktop\PowerShell Script\SharePointListName.csv"
               $SharePointListName|ForEach-Object{
               $ListName=$_.'NAME'
               if ($lists[$index].Title -eq $ListName)
               {
                    $lists[$index].Delete()
                    Write-Host "Web = $web, List = $ListName "
                    $web.Update();
               }
           }
     }
       }
    }
}
}

write-host "Total Count :" $count


 

 




Sunday, 14 April 2013

Redirect Infopath Webpart to Custom URl after Submit the Form


This is the solution to recirect the Infopath webpart to custom URl, after submit the form.

Step1: Create a page and add Infopath Webpart.
Step2: Refer the Infopath Form in Infopath Webpart.
Step3: Add a content Editor Webpart to the Infopath webpart page and add below code.

script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" type="text/javascript"
/script

script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"
/script
script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js" type="text/javascript"
/script
script type="text/javascript"
( function($)
{
$(document).ready(
function()
{
if($('#DialogFinalMessage').children().length>0)
{
window.location.href = "custom url";
}
}
);
} ) ( jQuery );
/script

Wednesday, 27 March 2013

Display Icon in the Library column in SharePoint 2010

Just like that :-
Following are the Steps:-
1. Go to SharePoint Library, create one column "Status" name with three dropdow values:-
     -Green
     -Red
     -Yellow
2. Create another column, Calculated (calculation based on other columns) and some code in formula.


Code Example:-
=IF(Status="Green","image url",IF(Status="Red","image url",IF(Status="Yellow","image url")))