Monday, November 26, 2012

What is Managed Path in SharePoint?

A managed path is a location within a web application
in which you can have site collections. When you create a web application, there are two managed paths created with it. The
first managed path is called the Root "/" path of explicit inclusion type. The second is called "sites" with
wildcard inclusion path. SharePoint 2010 My Site host comes with "Personal" Wildcard managed path.

Why We need Managed Paths in SharePoint?
Managed Paths in SharePoint used to group multiple sites based on some criteria. Also helps to maintain a logical structure in SharePoint. Say, You want to group all Sales department sites, then you can have: http://company/sales/Site1/ , http://company/sales/Site2/, etc.

SharePoint managed path examples:
Lets take an example. A typical SharePoint URL could be: "http://company.com/sites/Sales/apac/"
Where

http://company.com - Web Application

Sites- Managed path

Sales - Site collection

apac - Sub-site

Explicit vs Wildcard
There are two Types of Managed Paths we can create:

Explicit inclusion : Path can be explicitly used for only one site collection. (E.g. http://company/sites/hr) and no site collections can be created underneath the path. (But sub-sites can be created under site collection)

Wildcard inclusion: If you want to create site collections underneath a specific path, choose "Wildcard" (for example, "Sites" in http://server/sites/). Unlimited site collections can be created under the given path.

How to Configure Managed Paths for SharePoint 2010 Web Applications?
Managed Paths are defined at web application level. You can have
different paths for different web applications. They cannot be defined
for host header site collections. To define managed path in SharePoint 2010, Go to:

Central Administration >> Application Management.

In Application Management page, click on Manage Web Applications

Click the Web application for which you want to configure Manage Paths

Now from the ribbon, click Managed Paths.

From here you can configure Managed Paths for a particular web application.

Once you are done with managed paths, click OK.

Nested Managed paths
is it possible to nest a managed path under another managed path? Yes! You can create nested managed paths! Say for E.g. You create a Managed Path "/sites/" , then You create managed path as "/sites/sales". Now you can create site collections under each of these paths.

But you cannot create a site collection under /sites/ as "Sales", because once you create the managed path "Sales" under "Sites" it is marked as reserved!

SharePoint Managed Path Limits
Its a best practice to have SharePoint managed paths < 20. As per SharePoint 2010 Software boundaries and limits 20 Managed Paths can be created per Web application.You can expect performance issues if you exceed this limit!

Can I Create Site collections Under Root?
By default, Root Managed Path (/) is created as Explicit inclusion, which means you can create only one site collection at the root of the web application. However you can delete and Re-create it with Wildcard inclusion to enable site collections under Root.

How to Change site collection managed path
If you want to change the managed path of your site collection, You have to:

What if I delete the Managed path in use?
Answer: Your SharePoint Sites under the specific managed path will result: HTTP 404 Page Not Found!

SharePoint Managed path not in list?
Managed Path Not available in Create Site Collection Page, After deleting the site collection which was occupying the specified managed path already ? Refer my article for the solution: Managed Path Not available

SharePoint 2010 Survey Export to Spreadsheet missing?
Received end-user support tickets with the complaint: SharePoint 2010 survey export to spreadsheet is missing!

Export to Excel functionality in SharePoint surveys is available under the Overview view only! not on any other views like Show all Responses (Allitems.aspx) or Graphical Summary view!! so make sure you are on "Overview" page to export SharePoint survey data to spreadsheet.

Export to excel menu is missing in SharePoint survey overview view also?
There could be some other factors:

If you modified the overview view, closed the web part, You must Restore
the closed web part to get "Export to excel". Adding survey list
doesn't bring export to excel option!

I have seen, export to spreadsheet option is missing in SharePoint 2010 surveys, when I customized the Overview.aspx. Also it happens when I closed the original webpart on overview.aspx. Restoring the closed web part to the page resolves this issue, but adding survey list to the page doesn't!!

Make sure, the Overview view is set as default view!

SharePoint survey doesn't export all columns when you export to excel?SharePoint 2010 Survey had 50 questions, and when I was trying to export that to spreadsheet, got only 20 questions! To resolve, edited the overview view by clicking site actions >> Edit Page >> Modify Shared Web Part >> Edit Current View >> Check All Questions required)

URL Shortcut to Export to Excel:
Internally, Export to Excel options makes RPC call to owssvr.dll, So, we can directly hit the URL in the browser with List & View GUID parameters:

Thursday, November 22, 2012

Suddenly SharePoint Database Went Offline.
Analyzed Event Logs and found Database went offline because: Backup failure.SQL Server How to Bring Database Online?
Alright, How to Bring it back to Online? one line T-SQL!

Monday, November 19, 2012

Closed Web Parts? What are they?

When users don't need a particular web part on the page, they click on Edit drop down from Web Part Menu, and choose "Close" instead of Delete. They prefer Close rather Delete which is obvious!

Technically, When you close a Web Part, It doesn't appears on the screen. But still running on the background and eating up the resources. Its a best practice to delete the closed web parts. Because, closed Web
parts takes up the memory and could cause impact on performance.

How to Find closed web parts from SharePoint Interface

How to find closed Web Parts? Open the Web Part page in Web Part Maintenance Mode (Just append ?contents=1 at the end in address bar). E.g. http://SharePoint.com/sites/sales/default.aspx?contents=1 and look for "No" value under Open on Page? column.

How to Delete Closed Web Parts using SharePoint Interface

From the Web Part Maintenance Mode, choose the web parts which are in closed mode (Open on Page? column value "No") and click on "Delete" from the Toolbar.

How to Stop Users from Closing a Web Part?

Simple! Go to the web part properties, In Advanced tab Disable "AllowClose" check-box!

How to Restore Closed Web Parts using SharePoint Interface

Accidental close of web parts may happen while you edit web part pages. Here is how to Restore closed web parts.

Once you click, it will show all the
web part which are closed on this page.

Choose the web parts and click on "Add" to bring closed web
part to the page.
To delete a closed web part, Restore it first and then delete it!

How to Find and Delete Closed Web Parts With PowerShell:

Well, If its a single page, We canuse web part maintenance page to delete closed web parts. But for the whole site, its cumbersome. Closed web parts list can be retrieved by reading SharePoint Content Databases directly! But as per Microsoft's Advice lets not do it. Lets use PowerShell instead. This script will create a CSV file for logging Pages and closed web parts before deleting it.

Friday, November 16, 2012

Windows 7 comes with an In-Built Screen recorder: Problem Steps Recorder to record screen with series of screenshots and text. Its greatly helpful when we want to reproduce end-users issues and troubleshoot.

How to open : Problem Steps Recorder? Go to Run >> Type "PSR"

It launches the nifty utility.

With this tool, we can record screen by clicking on "Start Record", add comments in middle, pause and then resume recording. Once done, on clicking "Stop Record", it creates a ZIP file with .MHT file with all steps.

Wednesday, November 14, 2012

In SharePoint servers monitoring disk space is a common administrator task. Because, SharePoint servers may run out of disk space from SharePoint, IIS Logs, SQL Server transaction logs or even from SharePoint content (If you don't have Quotas enabled!)

There are lot of first-party, third-party utilities available, such as SCOM to Monitor disk space. What if you don't have such tools in your environment? no worries, Just PowerShell can do the monitoring of disk
space! PowerShell disk space monitoring can be a cost saver too!

Schedule this PowerShell script in windows task scheduler("powershell.exe D:\scripts\DriveSpaceMonitor.ps1" . Make sure PowerShell is in your "Path" environment variable!) on hourly basis. Script will run every hour and mail only when the drive's free space goes below the provided threshold value.

Tail: SharePoint 2010's Health analyzer has the rule to check "Drives are running out of free space." which can be utilized as well. But by default SharePoint health analyzer won't send email notifications and only display to users within Central Administration.

Tuesday, November 13, 2012

In my Laptop with Windows 7, I've SharePoint 2010 Installed for my tryouts. I use it whenever I'm out of network connectivity.

Problem is: Not quite frequently I use SharePoint from my laptop, but SharePoint services starts automatically when I turn-on my laptop and eating up my resources especially RAM.(SharePoint is resource hungry! Huh)

What I want is: Stop all SharePoint services and start only whenever I require them. I used run a batch file (or we can go to Services console) to stop SharePoint, SQL Server and IIS Services. Here is my batch file.

Delete Vs Recycle: Will the Deleted Items goes to Recycle bin?
No! Delete method doesn't send files to Recycle bin. But the Recycle Method does! So, call the Recycle method , if you want the deleted items to be sent to Recycle bin.

Why We need SQL Alias for SharePoint?
When installing SharePoint, you'll be prompted to enter the SQL Server instance and that's stored in farm's configuration. Creating SQL Alias for SharePoint enables you to change the Database Server of your SharePoint Farm! This will be a great help during disaster recovery, virtualization or migrations.

SharePoint SQL alias is a best practice! Its difficult to move SharePoint to a different SQL Server, If you don't use SQL Alias. When disaster strikes, just change SQL Server alias that SharePoint references.

Where to Setup SQL Alias?
SQL Alias to be set on All SharePoint Servers except DB Server (SQL Server!)
CliConfig.exe located at C:\windows\system32\cliconfg.exe in Windows 2003. For Windows 2008 and 2012, (or in 64 bit OS), its located at C:\windows\syswow64\cliconfg.exe

You don't need to install anything on your machine, as this SQL Alias Configuration utility comes with Windows. You can create it with SQL Server Config Manager also, When you have SQL Server installed it on the SharePoint server.

Select "TCP/IP" and provide the name for alias. Then fill in the host name of your database server and select the "Dynamically determine port" check box.
Now you have defined your SQL alias name. Click "OK" to complete.

How to Verify the SQL Alias Created?
We've created the SQL Alias. Lets make sure, Our SQL Alias works. Here is how: Login to any of your servers where you created SQL Alias (E.g. SharePoint Web Front end Server)

Create an empty text file, say: Test.txt, then rename it from Test.txt to Test.udl

Also, in the database drop down, you should see the list of databases from your SQL Server!

OK, Alias is configured on all SharePoint WFE/APP Servers. Now what?
Its a best practice to setup SQL alias during initial farm setup. if
not re-run SharePoint Configuration wizard on a established farm . If
your SharePoint is already up and running, launch SharePoint Products
and technologies wizard and configure your SharePoint farm with the new
SQL Alias.

Don't want to use SQL Server Alias? Run stsadm.exe -o renameserver -oldservername <oldname> -newservername <newname> on all servers to change the name of the specified server in the configuration database if the SQL Server is renamed.