SP2010 and Managed Metadata and &

I’ve been doing some work with dynamically populating a Managed Metadata term store using the API and data stored in a list.

The code was quite simple - check to see if a term existed, and if not, add it. The first pass of this routine would work fine, but then the second pass would crap out with an issue:

There is already a term with the same default label and parent term.

After a bit of debugging, I figured out it was falling over on a term that contained an & (ampersand) in the name. After a further bit of debugging (converting the character to HEX) it became apparent that it’s storing it as the wide (*pretty) rendition of the ampersand. And after some further research, it would appear that this is by design!

Read more

SharePoint 2010 + DocumentSets + OfficialFile.asmx max file size

Tripped over this issue today. This post explains exactly what’s going on - namely that when using the OfficialFile web service (for e.g., records management), the 50mb upload file size is in place, irrespective of any setting the Web Application General Settings.

Fix:

  1. Make sure that you have set the max file size on the web application
    Central Admin –> Manage Web Applications –> Select the Web Application –> General Settings –> Maximum Upload Size
  2. Open the following file and edit on each SharePoint server:
    C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14ISAPIweb.config
    Add the following section, then save and close
    <system.web> </system.web>

Didn’t even need to recycle the web services website/app pool. Perfect!

Read more

Current user is not a farm administrator - redux

A while ago, I posted about an issue with deploying a custom SharePoint retention policy where activating a feature was failing due to a permissions issue.

I fell over this issue again recently, but despite following all the advice in that post, I still couldn’t get things to activate and I didn’t really want to start giving all known service accounts local admin and DBO on everything in sight. So instead, I used a quick Powershell workaround. This works because PS always runs in the context of the Farm Admin, so I assumed it must have the relevant permissions. This script will find the feature you want to activate, and then activate it. Success is no message returned!

Read more

The OLE DB provider Microsoft.Ace.OLEDB.12.0 for linked server (null) reported an error. Access denied.

I’m noting this here primarily because I’m almost certain to trip over this again in the future. If you want to use the ACE or JET providers to read an e.g., Excel spreadsheet to an e.g., SQL Server table, then something like this is possible. Assuming you had a simple Excel workbook (Book1.xlsx) and in Sheet1 you had

Col1 Col2
Test Test2

You could use this to load it:

SELECT * INTO #tmpTable FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0 Xml;HDR=YES;Database=C:TempBook1.xlsx','SELECT * FROM [Sheet1$]')<br /> GO<br /> SELECT * from #tmpTable<br />

Read more

Auto generate SQL audit tables and database triggers

One approach to monitoring version history of items in SQL tables is to use an _Audit table version with database triggers. However, the creation and maintenance of the tables and triggers can be time consuming. This post provided a nice script to automate the creation but unfortunately it suffered a few issues. In the comments, someone posted a sproc version of the script - but unfortunately this was also broken.

So I have tidied it up and fixed the issues. My host doesn’t let me post SQL in these posts, so you can view the file here.

Read more

SharePoint Designer 2010 - list/library There are no items to show in this view - ListData.svc woes

This is one of those SharePoint errors. You know the ones.

Background

I was trying to use SharePoint Designer to customise a list. I opened up SharePoint Designer, and, although I could connect to the site itself, when clicking on the lists/libraries folder, you get a message saying:

“There are no items to show in this view”.

Weird. I tried this on various other web applications (even on the same server) and everything was working fine.

Read more

SharePoint 2010 - Managed Metadata - Required feature is not enabled for this column type

Quick tip: if you’re using the Managed Metadata service in SharePoint 2010, you may encounter an issue when trying to use it in a site column. When creating the column of type, Managed Metadata, you may encounter the error message:

Required feature is not enabled for this column type

This is simple to fix. In powershell, issue

get-spfeature | where {$_.DisplayName -eq 'TaxonomyFieldAdded'} | enable-spfeature -url http://yoursiteurl

changing the -url paramater to match the URL of your site. Job done.

Read more

Some notes on VMWare Converter

VMWare converter is a free tool from VMWare to convert Virtual Machines from one format to another. I’ve recently built an ESXi server and was looking to move some machines from VMWare Fusion 5 over to it. There are a few pitfalls to be aware of:

  1. VMWare Converter 5.0 is not compatible with ESXi 5.1 (yet). Don’t even try - Converter will just hang.
  2. Converter 4.3 is allegedly compatible with 5.1, but I didn’t have any success. I would get “invalid fault” exceptions.
  3. Convert 5.0 with ESXi 5.0U1 is painfully slow to transfer machines, even on gigabit lan. There is one option here that explains how to improve conditions. However, even with that fix, I only got transfer speeds of around 5mb/s when transferring file-based VMs.
  4. It may not help, but check DNS and network config between you and your ESXi server is setup. DNS in my ESXi was set up to be some random IP address which presumably did not help.
  5. Installing the converter on the machine you want to transfer is much faster. So rather than targetting a .vmx file, you can tell it to transfer the “currently powered-on machine”. Doing this with a simple W7 machine achieved speeds of anywhere up to 14mb/s. (Not great if you want to transfer a non-Windows machine, though!)
  6. You may encounter issues with VMs that have multiple virtual hard drives. I had a SQL Server with 3 separate drives installed, and whilst it did transfer all drives, with data intact, only the C: drive was alive when starting the machine. You may need to use DISKPART to get the other drives going again.

Will add more issues as I encounter them.

Read more

My VMWare ESXi build - Part 2 - Building ESXi

This is the second post in a series about running ESXi on a home server. See the first part, here.

ESXi is a free download from VMWare. You just need to register an account and install it. Simple huh? Well, not all the way. Two main issues:

  1. I didn’t install an optical drive (intentionally, although with hindsight it would have been a bit easier to have one)
  2. The Broadcam NetXtreme BCM57781 LAN card on my ASROCK board is not supported by ESXi. D’oh.

However, there are ways around this. If you’re running the same build as me, you should be able to follow these steps. If you’re using different hardware, substitute in the relevant bits!

Read more

My VMWare ESXi 5.1 build - Part 1 - The Hardware

This is the first part of a series on running ESXi on a home server. See the second part, here.

It’s a been a while since updating this blog. Apologies, but it’s mostly because I’ve been really busy. As part of that though, I use a lot of VMWare Virtual Machines. Being an Apple “fanboy” (gah) I use VMWare Fusion on my Macs which is great for running various virtual machines. (In fact, Windows 7 and Windows Server 2008 R2 seem to run a hell of a lot better virtualised rather than natively. Go figure.)

Anyway, it got to a point where I decided I needed a bigger and more robust framework to run virtual machines on. Simply speaking, running one or two VMs on my Mac is fine, but when you need to run several at one time with limited resources, it starts to get a lot more involved. Given that VMWare ESXi Hypervisor is a free platform for running a single server VM host, I figured I’d experiment with building an ESXi server for home use. This blog post details some of the pain I went through in getting there.

Before I get started, there are a few terms I will use:

HOST - the physical machine, that is running ESXi
GUEST (or guest OS) - this is the virtual machine(s) that then runs on ESXi

And quickly:

What is ESXi

ESXi is a cut down linux kernel that acts as a hypervisor. That is, it’s a piece of software that runs on the physical machine, and then presents the physical hardware to the guest machines that want to use it. It in itself is not an OS. So they key difference here between say VMWare Fusion or Workstation is that you’re not running an edition of e.g., Windows Server which itself is running Virtual Machines - you’re, moreorless, cutting out the middle man.

Read more