Monday, March 12, 2012

Create Enterprise wiki from Central Administration

  1. Open the SharePoint Central Administrator (CA)
  2. In the left navigation (Quick Launch), click Application Management
  3. Under Site Collection group, click Create Site Collection
  4. Select the web application, for the Wiki site from the dropdown menu
  5. Type “My Wiki Site” in the title and fill the description (Optional)
  6. For the web site address, type a proper character (ex: MWS)
  7. In the template selection area, select the proper language if you installed more than one language then select the Publishing Tab and “Enterprise Wiki”
  8. Specify the Primary and Secondary Administrator
  9. And finally select the right quota or leave it “No Quota” then click OK

How to Use Enterprise wiki


From the wiki page you can connect to other resources such as pages, lists, views and items without leaving the page which give you the ability to write the discussion faster and without linking error.

Connect to other Page

  1. Click the “Edit This page” link to move to the edit mode
  2. In the content editor, type “[[” to open the menu
  3. The menu will include the all pages available in the site as well List: and View: records
  4. Select the page then type “]]”
Connect to Page from Wiki Site

Connect to List

  1. Repeat the above steps 1 and 2
  2. Select the List: then press Tab which will open the all available list
  3. Select one then type “]]”
Connect to List from Wiki Page

Connect to View

  1. Repeat the above steps 1 and 2
  2. Select the View: then press Tab which will open the all available list
  3. Select the List you want then the view menu will open immediately
  4. Select one of the available views then type “]]”
Connect to List or Library View from Wiki

Link to List Item

In Wiki page you can immediately connect or link to item directly:
  1. Type [[
  2. Select “List:” then press Tab
  3. Select the list or library then press Tab again
  4. The menu will now show the all available items
  5. Select the item then press ]]
Connect to List Item from Wiki Page

Change the Link Name

To change the displayed text for the link, before typing the “]]” just type “|” and the text you want to show then type “]]”.



Wednesday, March 7, 2012

Hide SharePoint 2010 Ribbon for Read/View users

The SharePoint 2010 Ribbon is a very good feature, but in some case you need to hide the ribbon from users who does not have access to edit the page. Here you can hide ribbon from users who does not have edit access by modifying in the master page in SharePoint 2010.

First take a backup for your v4.master page and open in SharePoint Designer.

After taking the backup, now check out the master page and search for <div class="s4-title s4-lp"> and replace this with <div class="s4-title s4-lp" id="HeaderNavID" style="display:none">.
We have given one id property which is id="HeaderNavID" and one style property which is style="display:none"

Now go to the close
</div> tag of the above div <div class="s4-title s4-lp" id="HeaderNavID" style="display:none"> and place the below code
<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="AddAndCustomizePages">
<script type="text/javascript">
document.getElementById("HeaderNavID").style.display = "block";
</script>
</Sharepoint:SPSecurityTrimmedControl>

Happy SharePointing!!!

Powershell commands to Install-Activate-Deactivate and Uninstall SharePoint Feature

Powershell commands to:

-Install Feature:

Install-SPFeature FeatureFolderName
Here FeatureFolderName folder must be presented inside C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES directory.

-Activate/Enable Feature:

Enable-SPFeature FeatureFolderName -Url http://ur-site-url

-Disable Feature:

Disable-SPFeature FeatureFolderName -Url http://ur-site-url
Here FeatureFolderName folder must be presented inside C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES directory.

-Uninstall Feature:

Uninstall-SPFeature FeatureFolderName
Here FeatureFolderName folder must be presented inside C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES directory.

Tuesday, March 6, 2012

How to take backup & restore for one table?

We can take backup of table with schema and data.

Right Click on database
-Tasks
-Generate Scripts
-select a database
-Choose script options
select the script data option set to Schema and data only
-and proceed further....

Wednesday, February 29, 2012

Microsoft’s PowerPivot v2 Issue


New Version of PowerPivot V2 for SQL Server 2012 has been released.

And since not everyone knows that “2012 RC0” means “test version that won’t work with your servers, or anyone using v1” and that “2008 R2” means “version 1, the one you need for production environments,” well, this could still use some serious clarification.


That’s not a big deal except for:
  1. The release candidate likely isn’t as stable as the most up-to-date release of PowerPivot v1
  2. Workbooks created in v2 CANNOT be opened by v1, and that includes v1 server!
  3. There is no way to “downgrade” a v2 workbook to v1, so if you want to use a v2 workbook on v1, you have to start over
So be careful – v2 is awesome but using it unknowingly may have side effects you didn’t expect, at least until v2 is official released and the rest of your organization upgrades.
I’ve notified MS of this problem but so far they haven’t fixed it. Both v1 AND v2 should be available for download, with v1 the default, and both clearly marked.
If you want to download v1, here is the link:

Friday, February 24, 2012

Hide "Send To" Menu Item option in a documents context menu

Hide "Send To" option in a documents context menu. Add CEWP on document library view page and the below script to it.

<script type="text/javascript">
 _spBodyOnLoadFunctionNames.push("resetAddSendSubMenu()");

 function resetAddSendSubMenu()
{
   AddSendSubMenu = function (m,ctx) {};
 }
</script>

It turned out to be very simple by doing this:
  1. Go to the document’s view url, for example: http://example.com/Documents/Forms/AllItems.aspx.
  2. If it is a web part page, edit the page and add a Content Editor web part. Otherwise you need to edit that page in SharePoint Designer.
  3. Open the source editor (not the rich editor) for the Content Editor web part, or open the code view (not the design view) of that particular page in SharePoint Designer.
  4. Either inside the web part or the code view, insert the following script:
<script type=”text/javascript”>
AddSendSubMenu = function (m,ctx) {}
< /script>


Read more: http://www.information-worker.nl/2009/09/02/remove-send-to-menu-option-in-sharepoint-document-library/#ixzz1nKqK3mrv

Remove the recently modified link in Quick Launch

In SharePoint 2010 we all are familiar with the following annoying quicklaunch menu:
image
In SharePoint 2010, the recently modified items is one of many less-used feature. In software industry we are familiar with 80-20 principal. If 80% custom wants a feature then we should go with it and if you can satisfy 80% users then you have the successful product. I guess the ‘Recently Modified’ quick link doesn’t even needed by 10% people but the link is enable by default. Maybe this is a security feature to let administrator know what files have been modified recently. But there should have an on/off option as this is less wanted feature and most of the administrators want to hide this link. Justin has already found a way to hide the option by modifying template file as described in his blog. However, we can fix the issue without modifying the shared file. Specially in case of shared hosting we don’t want to modify the files from 14 hive. The two approaches described here is implemented by modifying master page. The first approach is acceptable but may have unknown side effects. On the other hand second approach is much better and less chance of side effects.

First solution:

1. Open your master page (default one is V4.master) and find the content place holder ‘PlaceHolderLeftActions’ as shown below:
<asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat="server">                
</asp:ContentPlaceHolder>
2. Now set the content place holder visible property to false. as shown below:
<asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat="server" Visible="false">            
</asp:ContentPlaceHolder>

Why it works?
The above trick works as in the aspx files the recently changed menu is put inside the placeholder. If you open a file in SharePoint Designer you can find that the recently modified menu is put under the placeholder with id ‘PlaceHolderLeftActions’ as shown below:
<asp:Content ContentPlaceHolderId="PlaceHolderLeftActions" runat="server">
    <SharePoint:RecentChangesMenu runat="server" id="RecentChanges" />
</asp:Content>

Warning
The content placeholder ‘PlaceHolderLeftActions’ mainly used in blog and wiki sites. So if you are using any of this kind of template then hiding the content place holder will hide others related links too. However, I have found that hiding the content placeholder in team site works perfectly.

Second and Better Solution

However, the above trick may have side effects, if the same place holder (‘PlaceHolderLeftActions’) is used by other pages. Another solution (which I think less side effects or no side effects) is to apply a css. As shown in the following screen, the ‘recently modified’ quick launch uses a css class named ‘s4-recentchanges’ (shown with firebug).
image
So we can another property ‘display:none’ to the same css class by adding the following extra attribute to master page’s header section:
<style type="text/css">
    .s4-recentchanges
    {
        display:none;
    }
</style>
You can even put the above section in a css file and refer the file in master page. The following image shows the master page with the css class:

image