Advertisements

Microsoft.BusinessData.Runtime.ExceededLimitException: Database Connector has throttled the response.

If you’ve created a BCS list before (such as defined by the excellent tutorial put together by Laura Rogers for connecting to a SQL data source using a SQL account – http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=90), and received this error on your Read List view page:

Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.

Correlation ID:117e242f-0985-42e9-9972-b1a879ce7e3b

After investigating the ULS Logs, located in %SYSTEM DIR%\Program Files\Common Files\Microsoft Shared\web server extensions\14\LOGS, and searching for the correlation id mentioned above. You may find the following error:

Error while executing web part: Microsoft.BusinessData.Runtime.ExceededLimitException: Database Connector has throttled the response. The response from database contains more than ‘2000’ rows. The maximum number of rows that can be read through Database Connector is ‘2000’. The limit can be changed via the ‘Set-SPBusinessDataCatalogThrottleConfig’ cmdlet.     at Microsoft.SharePoint.BusinessData.SystemSpecific.Db.ThrottledIDataReader.Read()     at Microsoft.SharePoint.BusinessData.SystemSpecific.Db.DbEntityInstanceEnumerator.MoveNext()     at Microsoft.SharePoint.BusinessData.Runtime.EntityInstanceEnumeratorBase.MoveNext()     at Microsoft.SharePoint.SPListDataSource.GetFilteredEntityInstancesInternal(XmlDocument xdQueryView, Boolean fFormatDates, Boolean fUTCToLocal, String firstRowId, Bo…

Thanks to the wonders of the interwebs, the solution to this is fairly simple, and the error explanation is extremely helpful. Do a search for this: Set-SPBusinessDataCatalogThrottleConfig, which will lead you to a great article on the Microsoft Business Connectivity Services Team Blog by Adam Outcalt here: http://blogs.msdn.com/b/bcs/archive/2010/02/16/bcs-powershell-introduction-and-throttle-management.aspx which will give you very great instructions on modifying the BCS throttling configuration.

Be careful with this however, the throttling is there for a reason. Not just to give you another option to configure.

Advertisements

SharePoint & PowerShell 101: Finding Cmdlets

imageI recently did a post on Listing all available PowerShell commands in SharePoint 2010. That is all well and good, if you want to manually browse through all of them. But what if you want to search for them?

 

Get-Command

Get-Command is a highly useful cmdlet in PowerShell. Today we are just going to use a basic functionality of it, to help us find and locate the cmdlets we need to use. Today, we need to do some work with the User Profile Service. However, we don’t know what the command names are that we need to use, only that we need to use them. For that, we can use Get-Command. If you need to figure out how to use the Get-Command cmdlet, run

Get-Help Get-Command

Which will return the following information about the cmdlet

image

This will return the usage of the Get-Command cmdlet. We are just going to use the –Noun switch to pass in our parameters.

Let’s start looking at the basics… we’re looking to find commands relating to the User Profile Service. So, let’s try searching for a noun of Profile

Get-Command –Noun Profile

Nothing is returned… oh right, it would appear that the Get-Command is literal, not a wildcard. However, we can use a wildcard character to help us search, as we have no idea what the name of the command is. Let’s try searching for *Profile*, that should do the trick.

Get-Command –Noun *Profile*

image

Hooray, results! However, we cannot see the entire name of the results returned. For that, we can use the Select-Object cmdlet.

Fore information on using that, try this in the PowerShell console

Get-Help Select-Object

So, let’s only pull the Name property in our results of the Get-Command

Get-Command -Noun *Profile* | Select-Object –Property Name

image

Much better! We can further refine these by adjusting our Noun, to just look at ProfileService

Get-Command -Noun *ProfileService* | Select-Object -Property Name

image

And there we go! Hopefully this helps you in your quest to add PowerShell to your arsenal of SharePoint management and development tools.

I’d love to hear what else you would like to learn about – leave me information in the comments!

Deploying and Activating Features in SharePoint 2010 with PowerShell

I was looking at an article on MSDN blogs today for customizing My Sites in SharePoint 2010. This post is not about that, but rather PowerShell that were there for deploying and activating a feature. Here is the text, direct from the site itself. This installs a feature (a), enables the feature (b), and then activates the feature on each site (c).

a.       Install-SPFeature -path "MyNewNavFeature"
b.       Enable-SPFeature -identity "MyNewNavFeature" -URL http://<mysitehost&gt; (Enables the new feature on the mysitehost)
c.       Enable the new feature on all personal sites:

$personalSites = get-spsite | where {$_.RootWeb.WebTemplate -eq "SPSPERS"}
foreach ($site in $personalSites) {Enable-SPFeature -Identity "MyNewNavFeature" -Url $site.Url}

 

The blog posting – where credit is due: http://blogs.msdn.com/b/spsocial/archive/2010/04/08/customizing-my-sites-in-microsoft-sharepoint-2010.aspx

Using PowerShell (and SQL) to Copy Users from SharePoint 2007 to 2010

imagePowerShell is a neat tool. There. I said it. What, you already knew that? Oh well… I still think it’s cool. You may have guessed, that due to recent posts (and a few yet to be posted), focused around PowerShell, I’ve been using it quite a bit. Today’s post is on how to get users out of your 2007 environment, and into 2010, specifically around FBA users.

I’ve been working with a new client recently, and we are migrating a 2007 based internet site to a 2010 based internet site, which has lots of FBA users. Now, I will not name the tool directly, but, with a certain migration tool, I spent the past week jumping through a lot of hoops to migrate the users over to 2010. A LOT of hoops. And no matter what we attempted to do, we just couldn’t get the users populated into the new 2010 site.

So, I rolled up my sleeves today and managed to complete the task in a short while… here’s what I did.

First, on the 2007 server, let’s call it SQL07.company.com, I went into SQL, and performed the following query to get the list of site collections within the content database of the web application in question. Luckily, there was only one site collection, so there was not much of a list here, but, I did need to get the GUID of the site collection, so, I did this:

image

Now that I had the site collection GUID, it was time to extract the users so we could add them to our 2010 server, which was some simple SQL code to build up the strings necessary. Now, I could have written more complex code, but, this just needed to get done (the select query is wrapped to display it all here).

   1: SELECT 'New-SPUser -UserAlias "' 

   2:     + REPLACE(tp_Login, 'acaspnetsqlmembershipprovider:', 'i:0#.f|sql-membershipprovider|') 

   3:     + '" -Web http://internet -DisplayName "' 

   4:     + tp_Title + '" -Email "' 

   5:     + tp_Email + '"'

   6: FROM UserInfo 

   7: WHERE tp_SiteID = 'CB14D956-9DE3-4A32-BD0A-155E93A663AA'

   8: AND tp_Login LIKE 'acaspnetsqlmembershipprovider%'

More information on the New-SPUser cmdlet in SharePoint 2010 can be found here: http://technet.microsoft.com/en-us/library/ff607868.aspx

And I switched the results view to Text in the query window in SQL, copied and pasted that into a text file, with a .ps1 extension, and called it from my SharePoint 2010 Administration Console (PowerShell), and off went the quick addition of thousands of FBA users into our new environment!

Now, what you will see here is a simple replace mechanism as well, for swapping all acaspnetsqlmembershipprovider: prefixed FBA users, to the new claims based format in 2010, i:0#.f|sql-membershipprovider|. The AND clause in the above SQL statement also only searches for FBA users, and not users out of the AD domain.

If you need to figure out what your prefix should be, add an FBA user to your site, and have a look at their profile page, it should list a funky username, that looks like the above: i:0#.f|membershipprovidername|.

Simple. Easy. And extremely effective.

Listing all available PowerShell commands in SharePoint 2010

Wanted to share this with my handful of readers, as it is a reference I use often, and also what comes back first in a search. The following blog has two commands for listing out all SharePoint-related PowerShell commands in 2010. In an effort not to steal his thunder, I’ll just post the link here so you can go get those commands.

http://sptwentyten.wordpress.com/2009/10/20/list-all-sharepoint-2010-powershell-commands/

101 Uses for PowerShell

This is just a bookmark for myself, or, for anyone else that may need it. My friend Erik Kraus, whom I have had the pleasure to speak with before at the last SharePoint Saturday Boston, pointed me to a blog posting he had done early last year, which listed 101 Uses For PowerShell. This was a great article he had written, which gave some great examples of ways to make use of PowerShell. Specifically, he had one section on SharePoint, in which he automated the creation of <File> elements and their attributes within your Element Manifests, so you didn’t have to type out hundreds, or possibly thousands of File, or other references, within your features.

That great link can be found here: http://blogs.msdn.com/ekraus/archive/2009/01/30/101-uses-for-powershell.aspx

I had unfortunately lost the link some time back, and needed it again today. So, after digging for it, I thought I would post it here, so I should never forget it again!

 

%d bloggers like this: