Wednesday, December 11, 2013

Missing server side dependencies. [MissingWebPart]

1.Enter as a Share Point Data Base Admin. Open SQL Server Management Studio.
Run the following Query
USE [WSS_Content_496dfc8bef2d46778f162ef78015268b]
SELECT * FROM AllDocs
INNER JOIN AllWebParts ON AllDocs.Id = AllWebParts.tp_PageUrlID
WHERE AllWebParts.tp_WebPartTypeID = '24019518-b52f-2e6d-868e-df1ed1b64b1d'



Modify the content Database and add web part ID

Tuesday, December 10, 2013

PowerShell Remove Features in SharePoint because of Health Issue For "Missing Feature"

Run The below power shell Method in SharePoint Management shell.
 function Remove-SPFeatureFromContentDB($ContentDb, $FeatureId, [switch]$ReportOnly)
{
    $db = Get-SPDatabase | where { $_.Name -eq $ContentDb }
    [bool]$report = $false
    if ($ReportOnly) { $report = $true }
   
    $db.Sites | ForEach-Object {
       
        Remove-SPFeature -obj $_ -objName "site collection" -featId $FeatureId -report $report
               
        $_ | Get-SPWeb -Limit all | ForEach-Object {
           
            Remove-SPFeature -obj $_ -objName "site" -featId $FeatureId -report $report
        }
    }
}
function Remove-SPFeature($obj, $objName, $featId, [bool]$report)
{
    $feature = $obj.Features[$featId]
   
    if ($feature -ne $null) {
        if ($report) {
            write-host "Feature found in" $objName ":" $obj.Url -foregroundcolor Red
        }
        else
        {
            try {
                $obj.Features.Remove($feature.DefinitionId, $true)
                write-host "Feature successfully removed from" $objName ":" $obj.Url -foregroundcolor Red
            }
            catch {
                write-host "There has been an error trying to remove the feature:" $_
            }
        }
    }
    else {
        #write-host "Feature ID specified does not exist in" $objName ":" $obj.Url
    }
}



To run only a report (-ReportOnly property):
Remove-SPFeatureFromContentDB -ContentDB "Content_DBName" -FeatureId "e8389ec7-70fd-4179-a1c4-6fcb4342d7a0" –ReportOnly

To remove the feature from all sites, site collections in the db run (no -ReportOnly property):
Remove-SPFeatureFromContentDB -ContentDB "Content_DBName" -FeatureId "8096285f-1473-45c7-85b7-f745e5b2cf29" 

Tuesday, December 3, 2013

Enable Bread crumb in sharepoint 2013

SharePoint 2007 and SharePoint 2010 we have Bread crumb option.  this feature is just disable by default. This post will help you enable it back using simple steps
1. You will need SharePoint Designer 2013 to achieve this. Once you have it downloaded and installed, open the SharePoint site in it.
2. Go to the Master page section and create a copy of the currently used master page. ( Its as simple as clicking on the master page -> copy -> right click -> paste :) )
3.Click on the newly created master page, and then click on edit file.
4. You will see the css code in it. Search for the term “GlobalBreadCrumbNavPopout” or “ms-breadcrumb-dropdownBox”. Below is a snapshot on how it looks
1
As highlighted, change the visible attribute to “true” and remove the tag  style=”display:none;”
5. After the changes, below is how your code should look like
2
6. Thats it!!.. Save the master page. Set it to default master page and you have the breadcrumb now available in your site.

Sharepoint Calendar Size Reduce as a Small Calendar

2010 CSS: /**** Small Calendar ***/
.ms-acal-item{height: 10px !important;}
.ms-acal-sdiv,
.ms-acal-mdiv,
.ms-acal-ctrlitem,
.ms-acal-month-weeksel,
.ms-acal-title{display: none;}
.ms-acal-summary-itemrow TD DIV{height: 15px !important;}
2013 Content Editor Web Part CSS: <style>
/**** Small Calendar ***/
.ms-acal-item{height: 10px !important;}
.ms-acal-sdiv,
.ms-acal-mdiv,
.ms-acal-ctrlitem,
.ms-acal-month-weeksel,
.ms-acal-title,
.ms-acal-month-top span{display: none;}
.ms-acal-summary-itemrow TD DIV{height: 15px !important;}
</style>

Thursday, June 14, 2012

Add Google search text box inside Sharepoint 2010 site

1. Go to Hive \Web Server Extensions\14\TEMPLATE\LAYOUTS\
2.. Create folder called Custom\goole.html
Copy the following code into Google.html

<html>
<form method="get" action="http://www.google.com/search" target='_blank'>


<div style="padding:4px; vertical-align:middle; ">
<table border="0" cellpadding="0" cellspacing="0" >
<tr><td valign="bottom" style=" height:75px; ">
<table cellpadding="0" cellspacing="0"><tr><td valign="middle" style="height:35px">
<input type="text"   name="q" size="25"
 maxlength="255" value="" />
</td><td>
<input type="image" value="Google Search" src="/_LAYOUTS/style/Images/Cute-Ball-Search-icon.png"/>
</td></tr></table>
</td>
</tr>
</table>
</div>


</form>
</html>


3.Add a Page Viewer web part add the following paths. /_layouts/Custom.google.html.

Monday, April 23, 2012

Upload Document into Document library using Quick Launch.

1.Go to "Site Actions"  "Site Settings".
2.Click on "Quick Launch" under "Look and Feel".
3.Click on "New Navigation Link"
3.Type the Following URL in "Type web Address"

        /sites/test/_layouts/Upload.aspx?List={26C77C31-DAC0-4F67-A296-3002C51A7814}&RootFolder=&Source=http:/serverurl/sites/test/Requestlib/Forms/Allitems.asp


we need to give the GUID of the document library. And Path of the SharePoint document library.
4.Click Ok.

Thursday, April 19, 2012

Automatically create a Moss 2007 Site Collection Backup

To create a batch file

1. Click Start, and then click Run. 
2. Type notepad, and then click OK.
3. In Notepad, type the following text:



@echo off
Echo ------------------------------------------------------------------
@SET STSADM="D:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM"
@SET MAINSITEURL="http://moss2007/sites/test"
@SET BACKUPFILENAME="E:\test\Backup\%date:~10,4%_%date:~4,2%_%date:~7,2%_backup.bak"
Echo Getting Site Lock
%STSADM% -o getsitelock -url %MAINSITEURL%


Echo Setting Site Lock to ReadOnly
%STSADM% -o setsitelock -url %MAINSITEURL% -lock readonly
Echo Backing up the top level site
%STSADM% -o backup -url %MAINSITEURL% -filename %BACKUPFILENAME% -overwrite
Echo Setting Site Lock to None
%STSADM% -o setsitelock -url %MAINSITEURL% -lock none
Echo ------------------------------------------------------------------




4. In Notepad, on the File menu, click Save As.
5. In the Save As box, select the folder where you want to keep your batch file. 
6. Using the ".bat" file name extension, type the name of the file in the File name box, for example, backup_batch.bat. 
7. In the Save as type box, click All files. 
8. Click Save.





Use Task Scheduler to run a batch file that backs up Office SharePoint Server 2007
To schedule a backup

1. Click Start, and then click Run. 

2. Type control, and then click OK.

3. Double-click Scheduled Tasks. 

4. Double-click Add Scheduled Task.

5. When the Scheduled Task Wizard appears, click Next.



6. Click Browse, and then browse to and select the batch file that you just created. (See IMAGE-1)




7. Click Open.

8. Type a name for your task, for example, backup_batch. (See IMAGE-2)



9. Select how often you want this task performed (for example, weekly), and then click Next.

10. Select a day and time that you want this task to begin, and then click Next.

11. Enter a name and password for a user, and then click Next. This task will run as if it were started by that user.

12. Click Finish. (See IMAGE-3)


Give Read Permission for SharePoint Add-in for Azure AD Send Mail to Office 365 Domain Group users.

Below are the Steps for Send Mail to Office 365 Domain Group or AD Group users from Provider Hosted ADD-IN. For this we needs to Give Permi...