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