Sunday, November 25, 2012

Displaying custom User Name in the Welcome Menu

I have seen so much content about approaching this problem in several ways, which to me are kind of solutions that they either:

-Force you to spend un-necessary long man-hours,

-Write too much of custom codes (writing user controls, etc.),

-Makes you try to understand the Welcome.ascx user control (really?? why? Microsoft has already done that).

So eventually, I ended up writing this post for the benefit of all.

SharePoint is an awesome “PLATFORM”, yes, I call it a platform. Not a Tool, or Application or a CRM or a portal, or a …. and the list goes on. By calling it a platform, I am encapsulating all of them together.

So, with so many stuff already provided out-of-box, we only need to know how to leverage them in a best possible manner to our benefits.

By leveraging, I also mean utilizing the excellent work that is being done by one of the Microsoft’s biggest community, the SharePoint community. You’ll find tons & tons.

The one such work that I am referring to is the SharePoint Services Library on CodePlex. Please find it here.

By using this, I have gotten to get this working in the most minimal way that I could find. Below are the pieces of the code that you would need to get your Welcome menu read aloud “Welcome Tango Charlie”. Pre-requisites being that you have a properly configured User Profile (and of course, if your name is Tango Charlie).

Okay, so we are going to modify our SP 2010 Master Page and place some lines of code in the <head> section.

Step 1: You may download the .js file and insert a script reference to the SPServices library within your <head>…</head> tags:

<script type="text/javascript" src="/_layouts/scripts/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/_layouts/scripts/jquery.SPServices-0.7.2.min.js"></script>

Pre-requisites:

a) You should make sure that you have a JQuery script references before referring to SPServices.

b) Refer the SPServices on CodePlex as the JQuery version requirements are strict for what version of SPServices you are using.

Step 2: Place the below script anywhere within your <head>…</head> tags as long as they follow the tags mentioned in Step 1.

<!-- Format the Welcome Menu -->
<script language="javascript" type="text/javascript">
        $(function() {
            var userFirstName = $().SPServices.SPGetCurrentUser({
                fieldName: "FirstName",
                debug: true
            });

            var userLastName = $().SPServices.SPGetCurrentUser({
                fieldName: "LastName",
                debug: true
            });
           
            var displaySection = $('span.ms-welcomeMenu').children('a.ms-menu-a').children('span');
            var textToShow = 'Welcome ' + userFirstName + ' ' + userLastName;
            // Set the text back to the Welcome Menu
            displaySection.text(textToShow);

          });

</script>

And that’s it. You have your name displayed with the “Welcome” prefix.

Try playing with the combinations/permutations of [fieldName: "FirstName"] and [fieldName: "LastName"] to get different text to display. Good Luck.

Friday, November 23, 2012

No item exists at http://servername/sitename/pagename.aspx?ID=88. It may have been deleted or renamed by another user

So, We have upgraded our MOSS 2007 to SharePoint 2010. One of the other challenges that we have been facing after this Database Attach process is that the links having query string parameters have started to fail (Surprisingly…..this error appears randomly on different links). The error it generates is : “No item exists at http://servername/sitename/pagename.aspx?ID=88. It may have been deleted or renamed by another user”

Well, as soon as I searched for this error, I got to see this Microsoft Support article having a resolution to this issue. You can find it here: http://support.microsoft.com/kb/972225

According to Microsoft, this is a know issue and this is what they suggest:

Change the query string parameter from ID to CustomID. Then change the details page from QueryString(ID) to QueryString(CustomID). Once this is done the page will display with no errors.”

So, when I changed my link URLs to “http://servername/sitename/pagename.aspx?BID=88” everything worked fine.

But here are a couple of questions that has kept me wondering, and I am still looking for an answer to them:

#1. My 2007 sites work perfectly with this piece of code. So does that mean, this issue has been introduced in SP 2010?

#2. Even in 2010, not all the links with query string parameters (?ID=nn) are failing. Some seem to work. This seems very weird. Any answers to this?

Friday, November 2, 2012

Setting up SharePoint 2013 Development Environment - Part 5

This is the Part 5 of the series for setting up a development environment for SP 2013 on a VM. As we know, this is the latest release for the new Microsoft stack of products that involves Windows Server 2012, SQL Server 2012, Visual Studio 2012 and SharePoint Server 2013 (or SP 15).
In this part 5, we will focus on the configuration of the PowerPivot for SharePoint 2013 using the PowerPivot for SharePoint 2013 Configuration tool.

Let’s start the PowerPivot for SharePoint 2013 Configuration tool.

clip_image002

Bummer!!! – We have an Error on the very first step.

image

Why 14.0.0.0?? Please note that there are 2 versions of this tool as described here.

So we incorrectly ran the PowerPivot for SharePoint Configuration tool. (Note there is no 2013 here).

Let’s try again and run the correct version this time, PowerPivot for SharePoint 2013 Configuration tool.

Nope, still seeing the same error!

Okay, let us try to see the Configuration Tool screen right behind this error message:

image

Can this be a pointer to an incorrect version of SQL Server? Let’s verify this with the standard MSDN post here.

Here’s the image for a quick reference:

image

Hmm…. That looks weird. I have “2100.1”, whereas MSDN says “2853.0”.

Okay, got it. I actually forgot to install the SQL SP1 CTP4 feature. Let’s go back and install it now from location: (www.microsoft.com/en-us/download/details.aspx?id=34700).

image

Once the install completes, start PowerPivot for SP 2013 Configuration Tool again.

You should be able to see this screen:

image

Click Ok. Next provide the appropriate Pass-Phrase and the PowerPivot Server for Excel Services Name:

image

See here if you want to learn more about this screen.

Then Click Validate. If you provided all correct information you’ll see the validation success message, Click OK. (Else follow the details on the error screen to fix the errors)

image

Click Run; click “Yes”, if you get a warning message:

image

This should start the process:

image

Once done, this completes the configuration process and it also completes this 5 Part series that I started almost a couple of weeks back.

Now you may go back to the creation of the SP Site Collection and start exploring the whole new world!!

Wednesday, October 31, 2012

Setting up SharePoint 2013 Development Environment - Part 4

This is the Part 4 of the series for setting up a development environment for SP 2013 on a VM. As we know, this is the latest release for the new Microsoft stack of products that involves Windows Server 2012, SQL Server 2012, Visual Studio 2012 and SharePoint Server 2013 (or SP 15).
In this part 4, we will focus on Installing SharePoint Server 2013 (popularly known as SP 15).
- Start the SharePoint installation.
image
image
After restarting and initial install of the preparation tool:
clip_image002
The server restarts again to complete the pre-requisites install:
clip_image003
Next, start the SP 2013 installation again and click the next link “Install SharePoint Server”.
If you see this error screen, you must restart the server before proceeding.
clip_image005
Once restarted, start the setup again, provide the keys, and accept the License Agreement.
On the “Choose a file location” screen, note the new path that SP 2013 is going to install itself. (I was wondering why I didn’t get to choose from the Install type: “Complete” or “Stand Alone”?).
clip_image007
Click “Install Now”. Once you see the completion screen, let the check-box be selected and click Close.
clip_image009
This should start the Configuration Wizard.
Click Next. Click “Yes” on the Services restart pop-up.
clip_image010
clip_image012
Click Next. Verify the Wizard Summary and click Next. The setup takes a while before you see the completion wizard step. Click Finish. This brings up the next screen, click “Start the wizard”:
image
Choose the “SPConfigAcct” service account created earlier from the “Use existing managed account” drop down, leave all the services selected as-is and click Next.
image
image
IMPORTANT: As discussed earlier, please do not create a Site Collection at this point of time. We need to first get back to the PowerPivot configuration tools and complete the remaining steps.
So, hit “SKIP” now to come to see this screen:
image
This completes the SharePoint Server 2013 installation.
At this point of time, let’s take another snapshot of the VM.
We will now move to the Part 5 of this series, where we will get back to finishing the configurations of PowerPivot for SharePoint Integration modes, as discussed in Part 3.

Wednesday, October 24, 2012

Setting up SharePoint 2013 Development Environment - Part 3

This is the Part 3 of the series for setting up a development environment for SP 2013 on a VM. As we know, this is the latest release for the new Microsoft stack of products that involves Windows Server 2012, SQL Server 2012, Visual Studio 2012 and SharePoint Server 2013 (or SP 15).

In this part 3, we will focus on Installing SSAS with Tabular and PowerPivot for SharePoint Integration modes.

So let’s fire up the SQL install once more and continue exactly as we did earlier till you reach the step to choose the Installation Type.

Choose to perform a New Install of SQL Server 2012.

clip_image002

Click Next, Next till you see the Setup Role screen. Select the SQL Server Feature Install.

clip_image004

In the feature Selection screen, choose the Analysis Services feature and click on Next.

clip_image006

Specify a name for your SSAS Tabular instance and click on Next.

clip_image008

Define SQL Server Analysis Services service account and click on Next.

clip_image010

Choose the Tabular Mode option, add click [Add Current User] to add an administrative user account, and click on Next till you hit the install button on the last step of the wizard screen.

You should see a success message after a while:

clip_image012

We are now going to install SSAS for PowerPivot for SharePoint.

Click through the same steps as we did in the previous method for “Tabular” mode till you see the Setup Role screen.

On this screen, select the SQL Server PowerPivot for SharePoint Installation option. Also uncheck the option for “Add SQL Server Relational Engine Services to this installation”, as we already did that earlier with the Tabular mode.

clip_image014

Click Next. The feature selection screen must already have the features selected for you.

clip_image016

Click Next.

Note that the Named Instance has already been set for you “POWERPIVOT”, so let’s name the instance ID, say “POWERPIVOT” to keep things simple.

clip_image018

Specify SQL Server Analysis Services service account and click on Next.

clip_image020

Add the Current User.

Continue with the installation process, and wait until the installation completes successfully.

clip_image022

Okay, now we need to install the following SQL Server 2012 SP1 CTP4:

(www.microsoft.com/en-us/download/details.aspx?id=34700)

This is required, as this gets you the Configuration Tool needed to configure the PowerPivot for SP 2013 integration mode.

So go ahead, download and Install the CTP4.

IMPORTANT: DO NOT run “PowerPivot for SP 2013 Configuration Tool” at this time. We will come back to this once we are done with the “SP 2013 Setup, Install and Configuration Wizard” process.

Monday, October 22, 2012

Setting up SharePoint 2013 Development Environment – Part 2

This is the Part 2 of the series for setting up a development environment for SP 2013 on a VM. As we know, this is the latest release for the new Microsoft stack of products that involves Windows Server 2012, SQL Server 2012, Visual Studio 2012 and SharePoint Server 2013 (or SP 15).

In this part 2, we will focus on Installing SQL Server 2012 on top of Windows Server 2012 that we installed on our VM.

- Start the Setup wizard for SQL Server 2012. Click on the “New stand-alone install…”.

image

Once you go through the steps of Updates for SQL Server, Setup Support Rules, License Keys and Accept Terms, you’ll need to choose from 3 different Setup Roles. I chose SQL Server Feature Installation.

clip_image002

On the next screen, Click [Select All].

clip_image004

Click Next. It should pass all the 3 Installation Rules as below:

clip_image006

Choose “Named Instance” and provide a name. Press TAB, this should update the Instance ID and all the 3 directory paths. Click Next.

clip_image002[4]

Click Next on the Disk Usage Summary.

Specify Service Accounts as created earlier for SSRS and SSAS. I’ll leave others as is (as a best practice, in prod environments, you may want to specify the service accounts for others as well).

clip_image004[4]

Click Next.

Leave the Auth Mode = “Windows” and click [Add Current User]. Click Next.

clip_image006[4]

clip_image008

Click Next. Then Click [Add Current User] to specify which user has permissions for the distributed replay controller. Click Next.

Specify controller name and leave the directory locations as is. Click Next.

clip_image010

Click Next. Then Click Next again on Error Reporting. It should be something like:

clip_image012

Click Next and then Install. Wait for the setup to complete.

clip_image014

clip_image002[6]

clip_image004[6]

clip_image006[6]

clip_image008[4]

This completes the SQL Server installation with SSRS (SQL Server Reporting Services) configuration in Native mode only.

At this point of time, let’s take another snapshot of the VM and do a windows restart.

So, that’s it for getting the basic SQL Server 2012 installed and running.

We will move to the Part 3 of this series, where we will get the SSAS with Tabular and PowerPivot for SharePoint Integration modes.

Saturday, October 20, 2012

Setting up SharePoint 2013 Development Environment - Part 1

Today I will be starting a fresh new series for setting up a development environment for SP 2013 on a VM. As we know, this is the latest release for the new Microsoft stack of products that involves Windows Server 2012, SQL Server 2012, Visual Studio 2012 and SharePoint Server 2013 (or SP 15).
I know there are a lot of blogs out there, already with many of these contents. My idea is to bring all those steps together in this series which will help me (or anyone else) try to begin exploring these new stack of products. (Note: It will be assumed that we have downloaded all the products required in this series.)

So here we begin:
Part 1: Installing Windows Server 2012. (You are reading this part.)
Part 2: Installing SQL Server 2012
Part 3: Installing SQL Server 2012 with SSAS with Tabular and PowerPivot for SharePoint Integration modes.
Part 4: Installing SharePoint Server 2013.
Part 5: Configure PowerPivot for SharePoint 2013 using the PowerPivot for SharePoint 2013 Configuration tool.

The first things first. As this is my virtual machine environment, you might need to trouble-shoot several other issues pertaining your local environment. As for example, network adaptor errors, connecting to internet on the guest machine, setting up the required services to run on the windows server, etc.
So, with these things in-place and working as per expectations (which normally does not in this real world), let us begin the part 1 now to get our OS installed.
- I will definitely say this was the easiest of all as it’s just about starting the setup and following the installation wizard to let the install step complete by itself. Once completed, you’ll get to see the Server Manager screen. Verify and make sure that the BITS Services is started. If not, start the service.
- Rename the Computer as per your liking. Do not restart at this moment. (This may lead to an error during the restart process while trying to update windows, and force an auto-reverting process.)
- Setup the windows auto-update and try to perform a manual check for recent updates. Download the updates and then restart and install updates. I saw that this process did avoid the auto-revert process while trying to perform certain updates.
- AD DS Configuration: Click [Add roles and features] on the server manager and click Next.
image
Select Role-Based or Feature-Based Installation. Click Next.
image
Click Next.
image
Select Active Directory Domain Services -> Then Click Add Features on the pop-up.
Click Next until you see the confirmation screen.
image
Select this check-box to auto restart after install completes, click Install.
image
Click Close.
image
Click on the Notification Icon and then click “Promote this server to a domain controller” (as “dcpromo” is no longer available in 2012).
Select “Add a new forest” and provide a Root Domain name (for ex: “ mydomain.com” without the quotes).
image
Now, it’s time to provide the restore mode password:
image
Click Next. As earlier, we will have to live by the DNS delegation warning:
image
Click Next on the Verify the NetBIOS Name assigned to domain.
Click Next on AD DS DB, LogFiles and SYSVOL.
Click Next on the Review Summary screen.
The install performs few prerequisite checks, shows the below success message (including few warnings):
image
Review the Results summary to verify if there are any major concerns for you to dig through.
I am happy with all that I see and click Install.
Once it completes, the server restarts.
The server aborted the restart, so I had to stop and then start the server manually.
Once it restarts, you’ll notice the domain in the username displayed:
image
You might also want to go ahead and install the Guest Additions to support the full screen display of the VM.
- Now let’s craete some user accounts. As this is just a Development environment, I will not be creating a separate account for each service applications as we normally do it for SP 2013. Instead I’ll simply create these two user accounts:
=> SSASSvcAcct: SQL Server Analysis Services Account.
=> SSRSSvcAcct: SQL Server Reporting Services Account.
=> SPConfigAcct: SharePoint Configuration Service Account.
Now, ensure that these accounts are added to “Domain Administrators” group.
At this point of time, let’s take a snapshot of the VM and do  a restart.
So, this is all for getting the OS installed and running.
We will move to the Part 2 of this series, where we will get SQL Server 2012 installed.