Thanks!

Will Search be the new User Profile Service in Sharepoint 2013?

The User Profile Service Application, especially the User Profile Synchronization Service, was a big headache in Sharepoint 2010. After numerous updates and different workarounds, most people got it working sort of.

After making som Sharepoint 2013 installs, I am wondering if Search will be the headache of Sharepoint 2013 like UPS was it for Sharepoint 2010.

It seems a lot of people have problems provisioning the Search Service application. Since Sharepoint 2013 depends on Search even more that before, a functioning Search is a must.

The problem seems to be provisioning/starting the Search Host Controller Service. If running AutoSPInstaller, it will time out at Activating Search Topology…

I myself have seen this problem several times when trying to set up a single development machine with AD and SQL on the same box. Using different accounts for different services seems to be the problem here, if you install everything as administrator you will probably be fine.

Anyway, what fixed it for me was to add the Search Service Account to local admins (=Domain Admins since this is the domain controller also) and to the sysadmin server role (!) in SQL. Then I logged on to the server as the Search Service account and set up search without problems. I had to use a new new for the Search Service Application, even though there was no Search Service Application listed in Central Admin or with Powershell, it seems to be some leftovers after the first try.

If this problem can be pinned down to the combination of Domain Controller on same box and using different accounts as best practise, this won’t be a big problem as most people won’t care about the service accounts and run everything as administrator in a simple dev/test setup like this. If this is a problem on “regular” installs then we can switch the UPS headaches for a new Search headache.

Powershell script for moving content databases

I needed to copy some databases from one farm to another to replicate production environment in a test environment. I will not go into the SQL operations of backup-move-restore of the actual SQL databases here, but only the command to attach the databases. When talking about +100 databases I found it sensible to make a script for this. As you can see I also added a command for testing before trying to attach. I also needed to detach all existing content databases in the test environment, so I made a function for this.

This Powershell script lets you specify which web application you want to detach/attach databases to, and if you have multiple database servers you can specify database server when attaching. When detaching, the database names are written to file (all databases on chosen web app are detached). When attaching, the database names are read from the same file. If you want to specify the database names for attaching yourself, you just put the database names (like “WSS_Content”) in a file called CDBnames.txt, one database per line, placed in the same directory as you are running the script from.

I am using the PowerShell commands Dismount-SPContentDatabase, Test-SPContentDatabase and Mount-SPContentDatabase.ø

The code:

Continue reading →

Powershell script for Timer Jobs

Recently I had to run some Timer Jobs repeatedly while verifying some functionality. Instead of wasting time going into Central Admin, finding the right job and refreshing the page to see if the job had completed, I made this script to do it for me.:

As you can see, I made a nice menu for you. I didn’t stop there, but I also implemented functionality so you can see the progress and status of the Timer Job. Should the Timer Job not succeed, you will of course be notified of this. Since the TImer Jobs I was running was the Content Type Hub and the Content Type Subscriber Timer Jobs, there are pre-made selections for these. In addition, you can also specify the Timer Job, either Web Application scoped or Farm Scoped, you want to run. In case you don’t remember the internal name, you can get all those listed as well.

So now I can sit back and drink coffee while this script is working for me. (Those of you who now me of course knows this is not true – I don’t drink coffee).

Here’s the script:

$wurl = "http://yourwebappurlhere";

function StartFarmJob
{
Write-Host " ";
$JobName = Read-Host "Timer Job internal name";

##Getting right job
$job = Get-SPTimerJob | ?{$_.Name -match $JobName}
if($null -ne $job)
{
$startet = $job.LastRunTime
Write-Host -ForegroundColor Yellow -NoNewLine "Running"$job.DisplayName"Timer Job."
Start-SPTimerJob $job

Continue reading →

What every Sharepoint’er should do

Most of you working with Sharepoint, either as developers or infrastructure specialists, have a virtual machine on your local computer you use for testing. However, this single-machine scenario does not reveal all the pitfalls you will need in real life Sharepoint.

When starting with Sharepoint 2013, I therefore wanted to have my own more complete test environment.

Hardware:

  • Asus P8C WS motherboard with Intel C216 chipset
  • Intel Xeon E3 1240 v2 CPU
  • 32 GB DDR3 1600 Mhz RAM (Kingston 4x8Gb)
  • 2x Intel 330 180 GB SSD’s

As you can see, this is a quite nice setup with Ivy Bridge all the way and last generation Intel SSD.

I couldn’t get hold of ECC memory in 1600Mhz, so unfortunately regular memory here. The memory defaulted to 1333 Mhz in BIOS, I had to manually set it to 1600Mhz. To prevent memory errors, I then also had to manually set the CAS Latency to 10 (which is what my memory modules officially support). I installed both VmWare Hypervisor (vSphere/ESX 5.0.0 U1) successfully to USB, and Proxmox 2.1

I decided to go with Proxmox, and I can tell you installing Windows Server 2008 R2 og SQL Server 2012 went faster than I have experienced in any production environment :-) So if you want a server-grade test environment that is lightning fast and power efficient, but at the price at workstation component, I can highly recommend this setup. I have never used Proxmox before, but it’s quite easy to use. Almost everything is done via a graphics web interface that is quite self-explanatory. Proxmox is running on Linux, so for some advanced operations command-line will be necessary.

Cascading Drop Down Multiple Levels

I have received quite a few request on how to set up cascading drop downs with more than two levels after my previous posts on the subject, so I made this post on how to set up cascading drop down with three levels. Actually you should be able to have as many levels as you like. This post is written for Sharepoint 2010 (both Foundation and server), but you should be able do use the same procedure for Sharepoint 2007.

The solution
The lists are standard Sharepoint, which gives great flexibility and stability. This way, the filtering is done in the forms for creating and editing elements. Because of this, you don’t even have access to the server to implement this.

1. Add the Jacascript
Download the Jquery file jquery-1.7.2.min.js by Jquery.com. Download jquery.SPServices-0.7.1a.zip from the Jquery Library for Sharepoint Codeplex site (newer version is probably also OK). Upload jquery-1.7.2.min.js and jquery.SPServices-0.7.1a.min.js (from the zip file) to a document library that everyone accessing your site has access to (a library on the top level site can be wise).

2. Create your relationship lists
Make three lists. In this example I use the Custom List template as basis for the list, but basically you should be able to use any list type you want. The parent list (Country) has only one field, the default Title.

Countries list:

The child list (Cities) has one field in addition to the Title field; the Country field. This is a lookup field from the Countries list.

Cities list:

The grandchild list (Hotels) has a Title field and a City field. The City field is a lookup field from the Cities list.

Hotels list: Continue reading →

Sharepoint 2010 Web Part Best Practise – Part 2 – Custom Properties

This is a follow-up on my first post Sharepoint 2010 Web Part Best Practise – Part 1. In this second post I will describe how to add custom properties to your web part. I will describe it step-by-step so it should be really easy to follow.

There are (at least) two ways to implement this. If you need validation control or control over the end-user interface for editing the properties, you will have to make your own editor. This includes placing your properties on top in the web part property editor. If the latter is the only concern, I choose not to write my own editor just for this. You will have to add a new class and quite a bit of code just to change to property group sorting order, and I just don’t think it’s worth it, although the best would normally to have your custom properties on top in the editor.

Also, if you would like a multiline textbox, and not just a single line of text, you will need your own editor. This is a thougher decision to make, sometimes the user friendliness be better with the cost of a bit more complex code. Your call on this one.

Performance seems not to be an issue though, the overhead by adding you own editor is non-existent or at leat well below a millisecond in my tests, so I would not consider performance to be a factor here.

If you read walkthroughs for earlier versions of Sharepoint, you will see that it is recommended to ckech if the current user has permissions to edit the web part properties before changing them. In Sharepoint 2010 you are not able to edit the web part properties via the UI if you do not have the correct permissions, which is why this seems not to be necessary, at least in the most common scenarios. If you have other views on this, I am happy to hear them.

What we will do is to:

  • Add a couple of string properties
  • Add a numerical property
  • Add a boolean property (yes/no)
  • Set some default values
  1. Start with an empty web part in a sandboxed solution, like the one you made in my previous blog post. Your web part (SiteDirectory.cs in my example) will look like this:
    Continue reading →

Sharepoint 2010 Web Part Best Practise – Part 1 – Site Directory Sandbox version

You can find a lot of recipes for Sharepoint Web Parts on the internet. Surprisingly, many people skip the basic parts that makes your solutions look professional. This blog post is going to show you how to develop a web part the way it should be, not just something you use for testing in your own environment. We’re going to:

  • Add a good title and description for the web part – extremely easy but often overlooked
  • Add a good title and description for the feature
  • Add an icon for the web part that is displayed when adding the web part and on the web part itself
  • Change the group the web part is displayed in
  • Add an icon for the feature to display when listing/activating/deactivating the feature
  • Functionality to remove the web part from web part gallery when feature is deactivated or removed

As you probably have guessed, we are using Visual Studio 2010 to develop the web part.

  1.  Create a new, empty project in Visual Studio. Choose a describing name, I use “UCCornerSiteDirectory” in this example. Choose to make this a sandboxed solution. You have now a empty project and can add the parts that you want.
  2. First, we will add our icon files. Because this is a sandboxed solution, we cannot deploy the image files to the file system, but we can still accomplish this very easy and without shortcuts. Right-click your project and choose Add – New Item:

  3. Choose to add a Module. I call the module “UCAssetsModule”.
  4. Now we will add icon image files to the project. I use a 16×16 pixel PNG image for the web part icon, and a 32×32 pixel PNG image for the feature icon. Be clever and use transparent background in your PNG – it is not always displayed with white background!
    To do this, right-click the module you just created and choose Add – Existing item:

    Now find and select the two icon files you have prepared. You will see the files are added to the module:
    Delete the Sample.txt file. You will see the elements file for the module is automaticall updated.
    Continue reading →

Cascading Drop Down Sharepoint Foundation 2010

After the release of Sharepoint 2010, the request for Cascading Drop Down, filtered drop down, dependent drop down or what you call them is not so common anymore. The reason for this is of course the Managed Metadata Service, which is included in Sharepoint Server 2010.

There are still times, however, when you’d want to use the functionality below to filter your drop downs. If you for instance are running Sharepoint Foundation, not Server, you won’t have the Managed Metadata Service available at all. Or perhaps you are running server, but you want to use list data and not terms from the term store.

Read more about Cascading Drop Down in my previous post for Sharepoint 2007.

The solution
The solution below is tested with Sharepoint 2010, and is basically the same procedure as the one for 2007. The list is still standard Sharepoint, which gives great flexibility and stability. This way, the filtering is done in the forms for creating and editing elements. Because of this, you don’t even have access to the server to implement this.

1. Add the Jacascript
Download the Jquery file jquery-1.6.2.min.js by Jquery.com. Download jquery.SPServices-0.6.2.zip from the Jquery Library for Sharepoint Codeplex site (newer version is probably also OK). Upload jquery-1.6.2.min.js and jquery.SPServices-0.6.2.min.js (from the zip file) to a document library that everyone accessing your site has access to (a library on the top level site can be wise).

2. Create your relationship lists
Make two lists, one for the parent (Country) and one for the child (City):

Countries list:

Cities list:

The Country column can be a look up from the Countries list, but you can just as well use a standard single line of  text column, which I have done here. This can theoretically give better performance, but you must of course be precise when filling out the County column so that the values here matches the ones in the Countries list.

3. Create the list that is actually using the Drop Down

Vacation Plans list:

This is the list where I want my Cascading Drop Downs. Country and City are lookup columns against Countries and Cities lists. The lookups goes against the title field in the respective columns.

4. Make the magic happen
In Sharepoint Designer, create your own NewForm.aspx (or EditForm.aspx, you’ll need both if you want it to work when editing items). Editing forms is a lot easier now with Designer 2010.

Just below
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">

insert this code:

<script language="javascript" type="text/javascript" src="/address to document library/jquery-1.6.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/address to document library/jquery.SPServices-0.0.6.min.js"></script>
<script language="javascript" type="text/javascript">
 $(document).ready(function() {
  $().SPServices.SPCascadeDropdowns({
   relationshipList: "Cities",
   relationshipListParentColumn: "Country",
   relationshipListChildColumn: "Title",
   parentColumn: "Country",
   childColumn: "City",
   debug: true
  });

 });
</script>

Save and create a new item using your new form:


Voila!

5.Explained:
relationshipList: “Cities” : this is the name of the relationship list = the list containing parent and child
relationshipListParentColumn: “Country” : Column name from the Cities list
relationshipListChildColumn: “Title” : Column name from the Cities list
parentColumn: “Country”: Column name from the list where the drop down is = Vacation Plans
childColumn: “City”: Column name from the list where the drop down is = Vacation Plans

You have lost of other options explained at the project site on Codeplex like sorting, multiple levels and so on.

Thanks to Marc D. Anderson for making this available.

I tested this on Sharepoint Server Enterprise 2010 with Service Pack 1 installed. It should work just as fine on Sharepoint Foundation. My installation is English Sharepoint with Norwegian Language Pack, but pure English should be jsut as fine.

KDC_ERR_S_PRINCIPAL_UNKNOWN

I got this error in the event log on a fresh Sharepoint Server 2010 February Cumulative Update installation:

A Kerberos Error Message was received:
 on logon session 
 Client Time: 
 Server Time: 17:6:26.0000 4/2/2011 Z
 Error Code: 0x7 KDC_ERR_S_PRINCIPAL_UNKNOWN
 Extended Error: 0xc0000035 KLIN(0)
 Client Realm: 
 Client Name: 
 Server Realm: DOMAIN.LOCAL
 Server Name: MSSQLSvc/sqlserver.domain.local:1433
 Target Name: MSSQLSvc/sqlserver.domain.local:1433@DOMAIN.LOCAL
 Error Text: 
 File: 9
 Line: f09
 Error Data is in record data.

Solution:

Continue reading →

Review Samsung Wave II S8530

I have written a review of Samsung Wave II (S8530). This is a nice phone with an excellent screen, good flow in the menus and also some nice perks in the Bada menus. Unfortunately the data connection does not seem to be completely stable.

Otherwise, this is a great phone for not so much money.

Read the review (in Norwegian) in VG.

Read the complete review (in Norwegian) in Amobil.