Obsecure search problem in a multi tenant SharePoint 2010 environment

By , March 1, 2012

I am currently working in a large, multi-tenant SharePoint 2010 environment and one of the tenant’s search wasn’t working properly.  Upon investigation, none of it’s sites were being crawled successfully, resulting in “Access Denied” errors in the crawl logs.  Search was configured correctly, it was configured exactly the same for each of the other tenants who’s search was working properly, and the account used had the proper level of permission.

After about 2 days of fruitless troubleshooting, I decided to look at the local hosts file of the crawl server… turns out this one tenant didn’t have an entry listed in the the local host file, pointing it to crawl a web server directly.  After making the entry, crawling worked for the tenant site, and search was fixed.

Maybe this simple, yet obscure check will save someone else some gray hairs!

Average usage statistics for a large enterprise SharePoint 2010 portal

By , December 29, 2011

With the year coming to an end, I did a little bit of digging into the web analytics reports of SharePoint 2010 to see how much the portal was used this year.

Since finishing the upgrade to SharePoint 2010 around mid year, we have had just over 7 Million page views and about 1,000 unique daily visitors, which seems like a lot to me, but I wanted to see how that compares to other portals.  Alas, I couldn’t find anything on SharePoint intranets to compare it to.

If anyone knows about their portal and feels like sharing, I would love to know!

Cant use SPContext.Current.Site in Sandbox Feature Receiver

By , August 11, 2011

This may be common knowledge to you Sandbox Solution pros out there, but I banged my head against it for a while today and felt like sharing.

I was attempting to grab the current site using SPContext.Current.Site like I normally do, but I kept getting the generic Sandbox error tell me I was outside the confines of my sandbox.  This seems to only occur when dealing with feature receivers, but I am not positive about that.

As a work around, you can get the current site through the properties object as such.

SPSite siteCollection = properties.Feature.Parent as SPSite;

Happy coding!

Huntsville AL SharePoint User Group Presentation on BI

By , April 21, 2011

This past week I presented on Microsoft Business Intelligence at the Huntsville SharePoint User Group, now officially known as the Rocket City SharePoint user Group.

In the presentation I went over the three main SQL Server Components (SSIS, SSAS, SSRS) and PerformancePoint.  Then we went through a live demo of importing some data into SQL Server with SSIS, building a data cube on it with SSAS, and making reports in SSRS and PerformancePoint.

The entire presentation lasted about an hour, and luckily didnt have any major hiccups.

Click here for the presentation (8 MB)

Side effect of setting content databases to Offline

By , February 18, 2011

It is pretty common for people to want a large department, such as Marketing, to have their own content database, or they may want to limit a content database to just a few site collections.  I have seen two different ways of accomplishing this and no real description of the negative side effects of one of the methods, so here is what I have experienced.

First the recommended method is setting the limit in the content database’s properties, and the second method is disabling the content database when it has reached the desired threshold (marking it as Offline).  At first both solutions will work equally well, as when a content database is Offline, no new site collections will be added to the database, but new content and sub sites created in a site collection that is already stored in the database will continue to be stored in the disabled database.

A seemingly unrelated issue that is very hard to troubleshoot however will eventually occur if you use the Offline/Disable method, so don’t use it!

Each site collection has it’s cache of user information for it’s members called the User Information List.  It primarily saves the person’s account name, name and job title and it is supposed to be updated to match the information in the User Profiles via a timer job.  When a Content Database is marked as being Offline however this timer job will skip over the site collections in the Offline databases and not update the User Information List.  So, eventually you will have a listing of users with the incorrect job titles (due to promotions) or names if they are ever changed.  We all know that Executives and Managers want others to know their lofty job titles, so this is a potentially big issue.

To correct this, turn the Content Databases back online, and run the following:

List the databases that are out of date:
stsadm -o sync -listolddatabases <n>

Delete the Synchronization information for the out of date databases (IT WILL NOT DELETE THE DATABASES)
stsadm -o sync -deleteolddatabases

Then Force the Databases to Re-Sync
stsadm -o sync

The Databases should now re-sync and update the information.  The timer job will then forever keep up with it.  Alternatively you could skip the stsadm commands and the timer job would eventually run and pickup the online content databases, but I like a little instant gratification now and again.

Making Custom User Profile Properties Searchable in SharePoint 2010

By , October 11, 2010

SharePoint 2010 allows for the creation of custom user profile properties in much the same way 2007 did.  This allows a company to tailor user profiles to fit their unique business needs and better promote social networking in the enterprise.

One issue I recently ran into with this however appeared when I tried to search on these new custom properties.  It so happens, that SharePoint does not automatically tie these new properties into the search experience, even if you mark the new property as one to be indexed.  I am going to walk through the steps required to create a new user profile property and make it appear in SharePoint 2010’s people search so hopefully someone else doesn’t waste as much time as I did getting this to work.

For this example I am going to create a Property called “Previous Customers” that lists all of the customers a person has worked with in the past.  Note that in my case this is a multi-value property, so make your selections accordingly.

Part 1 – Creating a Term Set for the Profile Property (This will store all of the Previous Customers entered by the users in a nice, clean set that is then reusable)

1)      Navigate to the Managed Metadata Service Application in Central Admin

2)      Create a new group for Profile Property Term Sets

3)      Create a new Term Set for the Profile Property you are about to create

Part 2 – Creating the Profile Property

1)      Navigate to the User Profile Service Application in Central Admin

2)      Click on “Manage User Properties”

3)      Click on “New Property”

4)      Fill out the information requested in the dialog box, selecting the term set created in Part 1.

5)      Make sure you select the Indexed check box

Now if you go to a user profile you should see the new property you just created.

So, at this point you may think (I did) that since you clicked the Indexed box, this will be indexed and make people appear in the People Search Results… Wrong!  We still have quite a bit of work to do.

Part 3 – Setting up the Metadata Properties in Search (This is kind of the tricky part)

1)      Navigate to your Search Service in Central Admin (Fast Query Service if using FAST Search)

2)      Click on Metadata Properties

3)      First make sure your Crawled Properties are there – Click on “Crawled Properties” (You may need to do an incremental crawl before they show up.)

4)      Do a search for your term (In my Case, PreviousCustomers – Results are shown in the image below)

5)      You should have two properties, one beginning with “ows_taxId” and the other starting with “People:” – If not, do an incremental crawl and try again, also make sure you filled out at least one profile with some sample data.

6)      We need to create a new Managed Property to map your custom user profile property to, so click back a couple of times and click on “New Managed Property”

7)      Fill out the resulting dialog box, mapping it to your Crawled Property – my example is shown below.

8)      Now go back to your crawled properties and  set their mappings per the image below

a.       Select ContentsHidden as a mapping for your People Attribute

b.      Do not select Included in Index in either one

Now if you kick off a crawl you should get some results back when you perform a search.  What this looks like is shown below.

So, you should notice that while you get a result back (I have “City of” as one of my previous customers) is does not display your custom field in the results.  To correct this we need to modify the xslt in the people results web part.

I hate editing xslt, but find it pretty easy if you copy some of what is already there.  Past Projects for example is an out of the box profile property that is like mine (Multi-Valued, appears in results, text, etc.) so wherever I saw PastProjects in the xslt, I copied that section with my term PreviousCustomers.

Part 4 – Modify the XSLT in the People Search Results Web Part

The three additions are below… I suggest using Visual Studio or something to edit the xslt other than the browser – much easier.

Add A Parameter (I Didn’t end up using this, but added it anyway)

<xsl:param name=”PreviousCustomersLabel” />

Declare a variable

<xsl:variable name=”haspc”        select=”($FilterNodeSet and $FilterNodeSet/@title=’PreviousCustomers’) or hithighlightedproperties/previouscustomers/@hashh &gt; 0″/>

 

Add an If Statement to display the Property

 

<xsl:if test=”$haspc”>

<li>

<span id=”FieldTitle”>

Previous Customers:

</span>

<xsl:call-template name=”RenderSimpleMultivalue”>

<xsl:with-param name=”multivalue” select=”hithighlightedproperties/previouscustomers”/>

<xsl:with-param name=”cutoff” select=”5″/>

</xsl:call-template>

</li>

</xsl:if>

 

The end result is what you wanted to begin with, your results being shown and the proper section being highlighted.


Excel Files in SharePoint as Data Sources in SSIS 2008

By , October 5, 2010

I ran into a problem this week when I wanted to use an Excel file located in SharePoint as a data source in a SSIS project.  I had done this before in SSIS 2005, but 2008 turned out to be a little tricky.

The problem I was having was that SSIS could not find the excel file, and through tinkering around gave me several different error messages.  I then noticed that I couldn’t browse the sharepoint files via UNC Paths ( \\servername\sitename\library ) from the server, but I could from my desktop.  (Note that I am developing on the server, Windows Server 2008 R2, instead of on my desktop – maybe that was the problem to begin with.)

This led me to check on the WebClient service, which was not even listed let alone not started.  So, after a little digging it seems that you need to enable the Desktop Experience Feature in Windows Server 2008 to install the WebClient feature, which then lets you connect to SharePoint via UNC paths.  After that was installed and the service was started, I was able to connect to my excel file like normal.

Hopefully this can save someone some time and frustration.

Free Flash Chart Web Part for SharePoint

By , July 14, 2010

The first time I made a web part was a couple of years ago when I wanted to chart SharePoint data inside of SharePoint.  I found some free flash charts that seemed pretty functional and away I went.

The web part turned out pretty well and I may have gone overboard adding additional features to it, but it definitely served its purpose (been in production for 2 years without issues).  Since it was the first web part I ever made, the code isn’t the most efficient and it was my plan to always go back and rewrite it.  But, with the coming of SharePoint 2010 and it’s own Chart web part, I don’t think I will spend the time to improve this, so here it is.

It does Pie, Bar, Column, line, area, doughnut and funnel charts.  A couple of the charts support three series of data, 2 as columns and one line which is pretty impressive.  Here are a few images of it running in a production environment.  It works in MOSS 2007 and WSS 3.0.  I haven’t tested it in anything other than that.  Enjoy!

Download the Project Here

Download the WSP Here

 

SharePoint iPhone App Roundup

By , July 12, 2010

So, I just got an iPhone 4, upgrading from an old windows mobile phone, and decided to investigate what apps were out there for SharePoint.  Oddly enough, I couldn’t find a blog comparing what was available, so that is what I am doing.  I downloaded and tested everyone I could find in the App store, with the exception of one that had a server side component.

Below are the applications I tested, along with what i felt were the pros and cons of each.

My choices:

The best free app is I-Share, as it is the only one that lets you edit list data, and I feel that is a very important feature.  That said, if SharePlus’s next version (2.0) comes out and offers the edit capabilities it is promising, that would likely be my number one choice for a free app.

The best paid app has to be PocketPoint, again because it offers edit capabilities.  And for 5$ it inst overpriced unlike the paid version of SharePlus.

Happy Apping!

Moshare – Free

http://moprise.com/ 

Good Bad
Strong interface for documents No support for custom lists 
Easy to email documents or links to documents Cannot edit data
Can open and display documents Search doesn’t seem to work
Decent for viewing contact lists and documents  
Good calendar support  

 

SharePlusLite – Free.  10$ version provides offline sync of documents.  Next version is supposed to add edit capabilities to both free and paid versions

http://itunes.apple.com/us/app/shareplus-office-mobile-client/id364895421?mt=8

Good Bad
Ability to View Custom Lists Cannot edit data
View of lists shows multiple fields, not just title Search only finds subsites and lists, not items
Supports Multiple Views of Lists  
Can open and display documents  

 

IShare – Free

http://spyk.com/Products/iShare/Pages/iShare.aspx

Good Bad
Ability to View Custom Lists When viewing list: Only item’s title is displayed
Ability to edit data in lists Can only view lists by default view
Search includes all site content  
Can open and display documents  

 

PocketPoint – $4.99

http://endurosoft.com/Products/PocketPoint.aspx

Good Bad
Ability to View Custom Lists When viewing list: Only item’s title is displayed
Ability to edit/delete/create data in lists Found a couple of small bugs 
Search includes all site content  
Can open and display documents  
Easy to email/download documents  
Can switch between views of lists  
File sharing feature shares files on iphone  

Attache – $0.99

http://www.lucruminc.com/attache/

Good Bad
Ability to View Custom Lists When viewing list: Only item’s title is displayed
Good for viewing contacts Cannot edit anything
  No Search
  Cannot open documents

 

ISP-Browser – $0.99

http://www.isp-apps.com/

Good Bad
Ability to View Custom Lists When viewing list: Only item’s title is displayed
  Cannot edit anything
  Poor design

Visio 2010 Automatically Link Data to Shapes Not Working Correctly

By , June 16, 2010

I am trying to build a dynamic Org Chart using Visio 2010 and SharePoint 2010 that will pull information from SharePoint Lists.

One list describes the Positions that make up the structure of Org Chart and the second list has employee information, and each employee and telephone number and the position that employee holds.  So the Position List builds the structure of the org chart, and the Employee list is extra data tied dynamically to the structure of the org chart.

In my testing, I have created two SharePoint Lists as follows:

Position List – Describes the Positions in the org chart.  Fields include:

ID: A unique value that identifies each position
Position: Text title of the potision
Reports_To: A number field that corresponds to the ID of the position, this position reports to

Employee List – Employee Information that will be dynamic and refreshable in the browser.  Fields include:

ID: A unique field that identifies each employee
Employee Name: Text field, the name of the employee
PositionID: A lookup field to the Position List ID field (The Position the employee holds)
Telephone Number: A Text field that holds the employees Telephone Number

First I get the structure of the Org Chart Built by importing data from an excel spreadsheet (Position List Exported to Excel) using the Org Chart Wizard – that part is very simple.

Then I click on Link Data to Shapes to connect to my Employee SharePoint List.  I provide the requested information and it successfully connects and displays the data from my SharePoint List in the External Data window.

The issue arises when I click on “Automatically Link”. I am linking the PositionID field of the Employee List with the ID field of the Position when they are equal.

I have tried it 500 different ways, and it is inconsistent in what it does every time.  I have highlighted all/some of the shapes, all/some of the external data items, and accessed the Automatically link button by the ribbon and right clicking and I get different results every time.  It never links them all, doing a random subset each time.  Even the ones it links are not usually correct (PositionID 2 should not link to ID 5 for example, because they are not equal).

Manual Linking works correctly by dragging and dropping each one, but the Automatically Link feature does not work.

UPDATE:  Apparently this is related to using the value in a lookup field to do the linking.  In the example I was using a lookup field (looked up a number in another list) and comparing that to a number field.  This gives the strange results below.  If I use two number fields as the comparison, it works as desired.  I believe this to be a bug as at the very least, it should act consistently in some fashion.

Below are some images of clicking the exact same button multiple times.  Notice how only some of the data is linked, and in the window it shows it is linked incorrectly.  I do it again and another subset of the data is linked… Inconsistent.  If anyone knows what is going on please let me know, but I am pretty sure it is a bug.