Fix: Unable to activate worker process proxy object within the worker process (by Sven Häfker)

Encountered the same issue as described by Sven Häfker and for sure his fix did the trick

Sven Häfker’s post:
Fix: Unable to activate worker process proxy object within the worker process
Issue:
We have encountered an issue that the Sandbox Worker Process (SPUCHostService.exe) of SharePoint 2010 wasn’t able to initialize itself on several servers. As a result Sandboxed Solutions couldn’t be used. We’ve found the following entries in the SharePoint ULS:

– Unable to activate worker process proxy object within the worker process: ipc://1787a8e0-45c3-48dc-9b3c-a60e8b4d6199:7000

– Error activating the worker process manager instance within the worker process.- Inner Exception: System.InvalidOperationException: Unable to activate worker processproxy object within the worker process: ipc://1787a8e0-45c3-48dc-9b3c-a60e8b4d6199:7000 at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWorkerProcessProxies() – Process creation/initialization threw an exception. Stopping this process.
“ipc://aec755bf-3ac8-4c2e-b5a4-9198b1bf027e:7000” – Stopping shim process. Shim process name: “SPUCWorkerProcess” Shim PID: “0x1868”
Shim service url: “ipc://aec755bf-3ac8-4c2e-b5a4-9198b1bf027e:7000” – Stopping proxy process. Proxy process name: “SPUCWorkerProcessProxy” Proxy PID:
“0x0AB0” Proxy service url: “ipc://1787a8e0-45c3-48dc-9b3c-a60e8b4d6199:7000” – Error activating the worker process manager instance within the worker process.

– Starting worker process threw – Inner Exception: System.InvalidOperationException: Unable to activate worker process proxy object within the worker process: ipc://1787a8e0-45c3-48dc-9b3c-a60e8b4d6199:7000 at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWorkerProcessProxies() – CreateSandBoxedProcessWorker() is called
– Created desktop: Service-0x0-2bea3589$\Microsoft Office Isolated Environment

Fix:
After trying to fix the issue for several hours, we tried to disable the “Check for publisher’s certificate revocation”-setting for the Service Account of the Sandbox and this solved the issue. You can do this by changing the following key in the registry:

HKEY_USERS\[SID OF THE SERVICE ACCOUNT]\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing
The value of “State” needs to be set to “0x00023e00”.

You can get the SID of the Service Account with PowerShell:

$(Get-SPManagedAccount -Identity “THE SERVICE ACCOUNT”).Sid.Value

Getting rid of “Could not find stored procedure ‘dbo.Search_GetRecentStats'” error

another one of those errors that can appear in your ULS logs which can easily be solved. This error also logs events in the Application eventlog with ID 6398 and 5586.

I found the solution to this issue on the SharePoint forum here

This happens when you have the Usage and Health Data Collection Service Application installed. This service application creates a database just for logging. Apparently the Search Service was trying to make entries in that database and couldn’t.

The solution to this issue is to enable the Usage Data Collection, which is not enabled by default when you create the Usage and Health Data Collection Service Application .

To enable the Usage Data Collection navigate to Central Admin\Application Management\Service Applications\Manage service applications. Once there highlight the WSS_UsageApplication (or whatever name you gave the service application)and select manage from the ribbon. Under Usage Data Collection check the box. Under Health Data Collection check the Enable health data collection box. Hit OK and the errors will be gone.

Getting rid of “Missing server side dependencies” MissingWebPart error in Health Analyzer for Central Admin – Update

Now that I am finalizing some of my farm installation I am starting to pay attention to those small issues reported by the Health Analyzer.

One of those errors in there is the following:

Title Missing server side dependencies.
Severity 1 – Error
Category Configuration
Explanation [MissingWebPart] WebPart class [8d6034c4-a416-e535-281a-6b714894e1aa] is referenced [2] times in the database [SP2010_ContentDB_CentralAdmin], but is not installed on the current farm. Please install any feature/solution which contains this web part. One or more web parts are referenced in the database [SP2010_ContentDB_CentralAdmin], but are not installed on the current farm. Please install any feature or solution which contains these web parts.

To get rid of this error you simply need to configure the SharePoint Foundation Search service though the Central Admin – Services on Server page on one of the servers in the farm.

Once this is configured, the error will go away.

UPDATE: on one of my other farms I noticed this error and configured the SharePoint Foundation Search service (which oddly enough once configured, changes its name to SharePoint Foundation Help Search)

a little more research and some Google results later I found an answer to this problem posted on the technet forums by John D Palm stating:
“This error will appear on a cleanly installed system in the Health Analyzer Reports until you visit the following pages:

SearchAdministration.aspx
SearchFarmDashboard.aspx
These are: Central Administration, General Application Settings, Farm Search Administration and then Search Service Application.

Browse to them and the error will no longer appear in the Health Analyzer Report.”

I followed John’s advise and indeed the error went away just after having visited both these pages and hitting the Reanalyze now button on the alert.

So there you go

Where is the RSS Viewer web part in SP 2010?

Like everything in SharePoint why make things simple if you can make it hard 🙂

Turns out that if you want the RSS Viewer webpart, you need to activate the “SharePoint Server Standard Site Collection features” feature in your site collection first.

Took me about 10 minutes of snooping around in the Web part gallery and trying ta add a new one, before I figured that one out.

Thanks to Craig Lussier for answering this exact question on the Technet Forum.

Fixing the Usage and Health Data Collection Service Application Proxy (By Tristan Watkins)

Unfortunately in every farm that I have provisioned so far using powershell I keep running into this issue that the Usage and Health Data Collection Service Application Proxy is set to Stopped.

The fix that Tristan Watkins describes on his blog here fixes just that.

Commands:

#Run Get-SPServiceApplicationProxy to enumerate the IDs of all the Service Application Proxies in your farm.
DisplayName          TypeName             Id
-----------          --------             --
State Service App... State Service Proxy  e51696f1-3523-4e20-9b75-578485024b37
Managed Metadata ... Managed Metadata ... 830bafcf-f0d3-4254-91e4-8cfe11840e27
Search Service Ap... Search Service Ap... a988d821-8247-4294-ba11-961b22e51f8b
Application Disco... Application Disco... af617d69-7332-49f3-a61c-0eef3f7470cf
Excel Services Ap... Excel Services Ap... b6c5b951-7b4d-4837-83f3-c916c1ef6c7d
WSS_UsageApplication Usage and Health ... 83301455-c854-4596-af5c-0bc6ee963b6d

#Copy the ID for the WSS_UsageApplication.
$UP = Get-SPServiceApplicationProxy | where {$_.ID -eq "PASTE ID HERE"}
$UP.Provision()

If you refresh the Manage Service Application page the proxy should be started now.

Provision SharePoint 2010 Search with custom database names

I’m more of a mitliple scripts guy for configuring my SharePoint 2010 farms than a 1 humongous script guy that does everything. I prefer to use one script for installing my binaries and creating/joining the farm and then several scripts for configuring specific service applications. I find it easier for troubleshooting.

Anyway, here is the script I created based on the AutoSPInstaller for configuring the Search Service Application using custom database names:


$SSADB = "SharePoint_ServiceDB_SearchAdmin"
$SSAName = "Search Service Application"
$SVCAcct = "CONTOSO\the_search_service_account"
$SSI = get-spenterprisesearchserviceinstance -local

# 1.Start Services search services for SSI
Start-SPEnterpriseSearchServiceInstance -Identity $SSI

# 2.Create an Application Pool.
$AppPool = new-SPServiceApplicationPool -name $SSAName"-AppPool" -account $SVCAcct

# 3.Create the SearchApplication and set it to a variable
$SearchApp = New-SPEnterpriseSearchServiceApplication -Name $SSAName -applicationpool $AppPool -databasename $SSADB

#4 Create search service application proxy
$SSAProxy = new-spenterprisesearchserviceapplicationproxy -name $SSAName"ApplicationProxy" -Uri $SearchApp.Uri.AbsoluteURI

# 5.Provision Search Admin Component.
set-SPenterprisesearchadministrationcomponent -searchapplication $SearchApp -searchserviceinstance $SSI

This will just create your required databases. From this point on you can configure the required crawl / query topologies using Central Admin.

Rename SharePoint 2010 Central Admin database

I had a post on this for SharePoint 2007 and needed to do the same thing for SharePoint 2010, but wanted to do this the powershell way instead of the stsadm way I used for MOSS. Not sure if that would even work…

turns out I didn’t need to reinvent the weel as Todd Klindt has already blogged about this here

The trick to all this is that for moving all site collections in a content database you would execute Get-SPSite with -contentdatabase parameter to get all the site collections for that content database and then pipe that to a Move-SpSite command. With the Central Admin content database the only way to get the site collections is to specify the GUID of the contentdatabase instead of the database name

In short, here are the commands:


#Create a new Content Database
New-SPContentDatabase -Name SharePoint_CentralAdmin -WebApplication http://sp2010:1000
#Get the Database GUIDs
get-spcontentdatabase -webapplication http://sp2010:1000
Id: d3d04cb1-b919-4262-b2d7-46733ef2c5df
Name : SharePoint_AdminContent_81476219-04f5-46b8-807f-31aa4afb4056
WebApplication : SPAdministrationWebApplication
Server : SP2010-DB
CurrentSiteCount : 2

Id : d8647aed-ef42-4052-814b-670b36fb8c1e
Name : SharePoint_CentralAdmin
WebApplication : SPAdministrationWebApplication
Server : SP2010-DB
CurrentSiteCount : 0

#Move the site collections
Get-SPSite -ContentDatabase d3d04cb1-b919-4262-b2d7-46733ef2c5df | Move-SPSite -DestinationDatabase d8647aed-ef42-4052-814b-670b36fb8c1e

Now do an IISRESET and check that the Central Admin site renders properly. If it does you can safely remove the content database with the GUID in it. Since I check the Central Admin site, I just delete the content database with the GUID from within the Central Admin Site

Updating User Profile pictures with powershell on SP2010

I finally had the chance to play around with user profiles. My customer asked me if it was possible to have the pictures of all employees show up in their respective user profiles in SharePoint and this without uploading the pictures themselves because they already had a dedicated website with all the pictures available. So the only thing to try to figure out was if it was possible to specify a link to the picture on a different website.

The customer was able to give me a CSV file with about 20K lines in it with 2 fields: Username + url of the picture. Worth mentionning was that the url of the user picture was not saved in any Active Directory property of the user object, sow e could not get it from there using the User Profile import process.

As it turns out the User profile actually has a property called PictureUrl which is completed by SharePoint when you upload your profile picture. So the task at hand was to write a script that could read the CSV file and update the user profiles. I started out with the script of Phil Childs and ended up with the following script:


$CSVFile = "C:\Scripts\pictureurls.csv"
$mySiteUrl = "http://people.contoso.com"

#Connect to the User Profile Manager
$site = Get-SPSite $mySiteUrl
$context = Get-SPServiceContext $site
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

#Read CSV file and process each line
$csv = import-csv -path $CSVFile
foreach ($line in $csv)
{
$up = $profileManager.GetUserProfile($line.UserName)
if ($up)
{
$up["PictureURL"].Value = $line.PictureUrl
$up.Commit()
write-host $up.DisplayName," --> ", $line.PictureUrl
}
if (!$up) {
write-host $line.UserName, " --> no profile found"
}
}

Now, I’m not a powershell expert (yet) so this script can probably be optimized or improved.

For my customer, we are planning to have this script adapted to check if the pictureUrl field has already been populated and only add the value when it is not and have it run on a regular basis. Ultimately my customer is looking into saving this picture url in Active Directory afterwhich we can play around with FIM to have it popluate the user profiles that way.

Change Locale of Site Variation Label in MOSS

Since some time, my customer had a nasty issue for which I did not see a solution at first. My customer is running its Intranet for years now on MOSS and uses a customized Publishing Portal with Site Variations in 3 languages, English, Dutch and French. The only problem with these Site variations is that the source Variation Label was created with the wrong Locale setting. The variation label was created with a name EN, language English (United States) , but with locale Dutch (Belgium) instead of English (United states).

Now when the hierachy was created, the subsite EN was created with the wrong locale. No problem there because you can change the locale of that particular subsite in the Site Settings – Regional Settings.

The problem my customer was facing is that clients targeting the root site collection and thus the Variation root site, where redirected to the wrong subsite if their browser had the locale Dutch (Belgium) defined. These client all ended up on the EN subsite instead of the Variation NL that was created with locale Dutch (Belgium).

The solution for this problem is to change the Locale in the Variation Labels in the root site. Unfortunately you cannot modify this value once the Variation Label is created (the field is greyed out). A possible solution would be to delete the Variation Label and recreate it. Because of the fact that this was the corporate intranet with lots of content on it, I did not feel very comfortable deleting the Variation Label, because this means you would have to delete the subsite as well before being able to recreate the Variation Label after which yould have to restore the subsite’s contents, etc. Furthermore the Variations system in MOSS is already very fragile and this would certainly break some other things.

Now after searching for a while and snooping around in the content database, I found out that these labels are stored in a hidden list in the Root site called, you’ll never guess, … “Variation Labels”. Now my trick for accessing this a hidden list by just typing the URL like http://intra.contoso.com/Lists/Variation Labels/AllItems.aspx did not work.

Powershell to the rescue!

I was able to access the list and change the locale value for the specific Variation Label with the following set of powershell commands:

#First Load SharePoint
[void][System.reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

#Connect to SPSite object
$site = New-Object Microsoft.SharePoint.SPSite("http://intra.contoso.com/")

#Connect to root SPWeb
$web = $site.AllWebs |where -FilterScript { $_.Url -eq "http://intra.contoso.com"}

#Connect to Variation Labels list
$list = $web.Lists |where -FilterScript { $_.Title -eq "Variation Labels"}

#Get the List item for the Variation Label
$listitem = $list.Items |where -FilterScript { $_.Title -eq "EN"}

#Check the Value
$listitem["Locale"]

#Modify the value to English (United States)
$listitem["Locale"] = 1033
$listitem.Update()

#Dispose of objects
$listitem.Dispose()
$list.Dispose()
$web.Dispose()
$site.Dispose()

Now if you ever need to chaneg the locale value, then this script will help you out. The only thing you need to find out is the value for your specific language. What I did to find out the specific value was to create a new Variation Label on my test environment with teh locale I wanted and fetched that value with the exact same commands.

Out goes Community Server, in comes WordPress!

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging! (in my case continue blogging )

This is the first post you get to see once you get WordPress going. I thought I’d leave it up here. I got more than enough of the spam mails getting in through my blog and not finding any way to implement a captcha thingy into the instance of Community Server I was running that I decided to give it a go to another blogging tool. Now for me the most important thing was how would I keep my original posts. Luckily I still found an export module to BlogML for Community Server 2008.5, which did the trick. Armed with that knowledge I gave a go at WordPress.

Hope you can live with it as much as I can 😉

I am still trying to figure out how to implement the exported permalinks, so if you got here through a Google/Bing or whatever search and didn’t find the original post you were looking for, just use the search function on this site and you will probably find that article you were looking for after all

For those of you wondering: I am running WordPress on an Apache webserver. Now how cool is that for a SharePoint consultant!