Tuesday, July 12, 2011

Moved the blog!

Dear Readers, I have moved my blog and all its entries today to “SharePoint Prayogs in the Field”.

Bye the way “Prayog” is a Hindi word and it means “experiments”. I could not think of any better name!

Locate SharePoint FEATURE from Title

Many times, I wanted to know elements of a particular FEATURE (any scope) before I hit the Activate button so that I can inspect the elements manifests and understand what the FEATURE would do to the site (or site collection, farm or web application).

SNAGHTML116d43

And I figured out that is no straightforward way to locate the FEATURE on the SharePoint Root. I wish Microsoft had provided a link “Open FEATURE folder” on click of which, it opens the FEATURE’s root directory for me…. At least for the Site Collection Administrators?

Anyways, I needed it desperately, so I had to help myself. I also posted a question on SharePoint Overflow and see if someone has already done that before. I wanted to do it with minimum efforts and finally, came up with following simple PowerShell Script;

Explorer (Get-SPFeature | Where-Object {$_.GetTitle([System.Globalization.CultureInfo]::CurrentCulture) -eq "Content Organizer"}).RootDirectory
What it does is retrieves the FEATURE’s list and then applies filter to select FEATURE which matches my Title. Getting Title was tricky but not as much as you can see above. And finally, I wanted to save few more clicks and keyboard strokes, so I used “Explorer” command and opened the directory in  Windows Explorer!
Hope this helps….

Wednesday, May 25, 2011

Small Business Server 2011–I implemented

Recently I got an opportunity to provide a server solution to a local small business in NJ. They are into trucking business and the business owner wanted to replace his old Dell PowerEdge server. When I visited the office, I instantly thought that the server is being replaced because it was making so much noise Smile

Anyways, I grabbed the opportunity with both hands and started looking towards small business server because the name itself suggests that they are made for small businesses like that (just like the Windows Home Server made for my home and no doubt I love it… I have not migrated to Windows Home Server 2011 yet). All they wanted was a domain controller and a file share. But when I started looking into Small Business Server’s feature set, I thought of making a list of things they would get and I did exactly so. And you know what.. it was not that difficult to sell it. I proposed the cost of hardware, SBS 2011 and the client licenses and it was accepted as-is. After all, who does not like 15 features when only 2 were expected. The small business was excited about emails for each individual and the remote access and not to mention access to emails on their smart phones….

I tried to order SBS 2011 online but realized that HP, DELL etc are still a few weeks or months away from shipping it. So I thought of building it and I ended up putting a huge hardware order at my favorite site: newegg.com. I also thought of making a RAID 5 array. I ordered 3 hard drives and configured RAID 5. It did not take much to realize that RAID 5 was very slow.. so finally I ordered the 4th drive and configured a RAID 10 solution on it. This was the first time I configured RAID feature. I did not order a dedicated controller because the on-board controller was giving acceptable performance. I am still surprised at the price of the dedicated controllers though.. they are too pricey!

I spent at least 2 weeks (part time, of course) to build the server and install SBS 2011 on it. The installation of OS was – as usual – very smooth and post installation was a bridge too. Well done Microsoft! I could not test the email functionality at my home though because it needed a dedicated domain registered with godaddy.

The small business had already registered a domain with godaddy, so connecting SBS to internet and configuring domain was not that difficult after I moved the server to the small business location. In the mean time, I suggested them to get a static IP from their ISP and that was already done!

So the end result is that the deployment was successful, I had all their client computers connected to the SBS 2011, their file shares moved to SBS 2011, each employee now had their own email address and guess what, they were able to send and receive both internal and external emails… Emails was most satisfying (apart from the payment from the small business) to me though.

I wish a few more small businesses contact me soon Smile….

My next project is to upgrade to Home Server 2011. I am little reluctant at this moment because I know I will not have the drive extender functionality anymore. But then now that I know RAID, I want to check if my motherboard supports RAID configuration so that the decision to move to Home Server 2011 is easy!

Wednesday, December 15, 2010

Missing Term Store Management link under Site Settings

I came across an interesting question today, the user was not able to find Term Store Management link under Site Settings.

I investigated it further and verified that it was not available to one of my site collection even if an appropriate Service Application was running fine and associated with my Web Application.

As usual, I went to the “SharePoint Root” to go to the “root of the problem” and found that the link is being made available by a FEATURE named “TaxonomyFieldAdded” and the stapling was made by FEATURE named “TaxonomyFeatureStapler”. I found that the Stapling FEATURE did not include Blank site template… Remember! it includes GLOBAL site template which includes everything but the blank site template!

So there it is! If you create your site collection using Blank site template, “Term Store Management” link will not be available in Site Settings.. Hope this was helpful!

Thursday, November 4, 2010

Hiding “New Site” in Site Actions Menu

Today, I came across an interesting question in a forum and the question was.. “How to hide “New Site” option available in the Site Actions menu when the publishing feature is enabled.

Initially, I thought it would be easy with HideCustomAction element in a custom feature. However, it did not turn out to be that easy. After some investigation I figured out that that menu item is created by Publishing feature in code. HideCustomAction would have helped me if it was created declaratively. So, I took the same approach as Publishing feature to hide the menu. Here is the solution:

This was tough when I started doing it today. It is possible via feature using a CustomAction element in the elements.xml and some code. I tried a no-code solution but it was not possible.

 <CustomAction
        Id="HideCreateSiteInSiteActions"
        Location="Microsoft.SharePoint.StandardMenu"
        GroupId="SiteActions"
        Sequence="901"
        Title="Publishing SiteActions Menu Customization"
        ControlAssembly="Your Assembly full name"        ControlClass="your class full name">
  </CustomAction>

Following code would go in class:

public class YourClassName : WebControl
    {
        protected override void OnLoad(EventArgs e)
        {
            var siteActions = ToolBarMenuButton.GetMenuControl(this);
            siteActions.MenuControl.PreRender += (o, args) =>
            {
                var targetMenu = siteActions.GetMenuItem("MenuItem_CreateSite");
                if (targetMenu == null) return;
                siteActions.MenuControl.HiddenMenuItems.Add(targetMenu);
            };
        }       
    }

The scope of your feature would be "site". Also, don't forget to put SafeControl entry for your class in the web.config or it may not work.

Monday, November 1, 2010

I am active at StackOverflow.com and SharePointOverflow.com

Recently I came across a presentation from Scott Hanselman and he insisted that “Every Developer must have a blog.. period..”. After inspired by that presentation, I thought of giving it a try and I decided to spend a few hours every week for these two activities:

1. Help the community by answering the questions they have!

2. Blog interesting things that I come across

For the first activity, I decided to actively participate in SharePoint 2007/2010 related questions posted by people at StackOverflow.com and SharePointOverflow.com. I like these sites because they are simple and fast.. very simple reason indeed! And here I am, after one month of this activity, I gave about 50 answers and collected about 700 points. Wow, looking back, I did not anticipate that I would give that many answers and get many points! I must state that I enjoyed a lot while helping the community, I learnt a lot. Many of those answers that I have required me to research and even work with VS.NET to get the correct answer. So, I want to continue with this… and who knows after a year I may be recognized by Microsoft as an MVP… that would a quite an achievement.. pinch me, I am dreaming!

This blog and the posts that created last month is the proof of my second activity. Let’s see how many interesting things I come across and I am able to blog it or not!

Wrong values for Location and GroupID of Custom Actions specified in SharePoint SDK

While I was researching a problem reported by a user @ SharePointoverflow.com, I realized that if I wanted to add a link to Central Admin site’s “Site Collection” section of “Application Management” and use the Location and GroupID specified in SharePoint SDK, it would NOT work!

It wasn’t a pleasant surprise to me. The problem which lead me to investigate the issue is: http://www.sharepointoverflow.com/questions/6689/central-admin-custom-action-menu-not-appearing

If you are interested in correct values, please visit: http://bloggingabout.net/blogs/arjen/archive/2010/02/04/custom-action-definitions-in-sharepoint-2010.aspx

I finally found the problem and answered to the user. It turned out that I have to mark the feature element with AutoActivateInCentralAdmin="TRUE" so that when the feature which is scoped at “Web” would activate automatically in the central administration and display my custom action.