Custom File Type Icons in SharePoint 2010

The chances that your Company, like ours, is going to want to upload documents to SharePoint 2010 that are not recognised by SharePoint out of the box and show the generic “blank document” style icon. Fear Not! It’s relatively simple to add an icon for a certain file type – PDF’s for example. These steps will need to be repeated on each WFE server in your SharePoint farm.

First thing you are going to want to do is get an icon for PDF files, or any other file type for that matter. (The icon for PDF’s can be found here)

Then head on over to C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/14/TEMPLATE/IMAGES/ on your SharePoint server and place the downloaded icon there.

Once this is done open C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/14/TEMPLATE/XML/DOCICON.xml in notepad or something similar. Remember to make a backup of this file before you modify it incase everything goes Pete Tong!

Look for the lines in the file that start “<Mapping Key=” and add <Mapping Key=”pdf” Value=”pdficon_small.gif”> on its own line. Save the file when you are done.

Now depending on your maintenance schedule you need to restart IIS for this change to take effect. If you don’t have a certain maintenance window then go ahead and open an elevated command prompt and type IISRESET. A system restart would also do the trick.

Once either the service has restarted, or your server is back up from that long reboot while the RAID card initiates, browse to one of your SharePoint sites and upload a PDF. Simple.

Of course this method can be used for any file type you like by simply substituting Key=”pdf” with Key=”<File Extension>” and Value=”pdfIcon_small.giz” with Value=”<Icon_Path.jpg>”. Don’t forget that most web browsers will not render a .ico file though!

SharePoint 2010 “Group cannot be found” error

I ran into a very interesting error in SharePoint today and thought I would document it as I attempt to fix it. Hopefully it will help somebody else in the future.

In my site collection -> Site Actions – > Site Settings – > People and Groups I noticed that all of my groups were duplicated. If you try to click on one of the groups to edit it there is no issue, but the second group throws the following error.

I was actually going to delete a load of groups to start with, so I decided to delete them all and re-create the ones I need. Since I can’t get into edit the group in the GUI, I tried powershell on the server. This didn’t work either and bombed me out with the same error.

Now what? I decided to check Central Admin and take a look at the content databases. There appeared to be 2 site collections in the content database. I can only remember creating 1, although the site was migrated from Sharepoint 2007 so maybe that had something to do with it.

I then backed up the content database and restored it in our development environment to do a bit more digging. When you hover over the group name in SharePoint the URL has ID=### at the end. I fired up MS SQL Management Studio and took a look in the “Groups” table and noticed that the groups present had the same ID’s as the URLs for the groups displayed in SharePoint that I could still edit. There were no rows for the groups that I could not edit though. It looks like the groups have had their ID’s changed for some reason.

Then I edited the table and copied the row of a working group and inserted a new row, pasting from my clipboard and changing the ID to the ID in the URL or the group that was not working. I couldn’t commit this as the Title already existed in the bale, so I added a 1 to the end of the title for the row I had just created and committed it.

I went back to SharePoint and clicked on the group that was not working. It worked…. I could now click Settings – > Group Settings -> Delete and the group was gone, both from SharePoint and from the Groups table.

I seriously wouldn’t recommend this on a live server, but I repeated these steps in our development environment for each group and I was successful in deleting all of the groups from the SharePoint site collection.

My Shiny New Alienware m17x R3

Somehow, as if by magic, I have managed to persuade work to buy me a nice new Alienware m17x gaming laptop. I decided to show you all what it is like, not to brag, but to educate…

What an awsome machine it is!!! Check out the spec below.

Intel Core i7 2630QM Quad Core @ 2Ghz
16GB DDR 3 @ 1333Mhz
2 x 320GB 7200RPM Disks in RAID 0
AMD Radeon HD 6870M 1GB GDDR5
17.3″ 1920×1080 Full HD WLED LCD display
Blur-Ray Reader / CD-RW DVD-RW Slot loading Drive
HDMI Output
HDMI Input
USB 3.0

It’s really is an amazing machine considering it’s portability. It’s a shame it gets used more for work and running virtual servers in a development environment then to play games…  I have obviously tested it with a few games though, which it handles admirably.

The sound quality from the Klipsch speakers is quite impressive for a laptop, although I would have preferred a bit more bass. It does however have 2 headphone ports for gaming headsets, and allows the gamer to fade between game sounds and player chat through Ventrilo or teamspeak. A digital audio out is also handy for connecting my 7.1 surround sound system with just one cable.

The graphics output options are pretty impressive for a laptop, having HDMI Out, VGA 15 pin D-sub out and a Mini Display port out offer plenty of flexibility when outputting those PowerPoint presentations, or of course for playing your games on a larger display. The laptop also has a built-in WiHD transmitter, which I am told will wirelessly transmit HD video to a WiHD ready TV or receiver. although I havn’t tried this feature yet I’m sure it is a handy for Gamers.

HDMI In support allows you to plug your PlayStation 3 or XBOX 360 in and use the built-in HD display of the laptop to play your console games.

Two USB 3.0 ports are a very welcome feature, allowing me to use an external hard disk to run VM’s from without contending my internal hard disks.

All in all I am very pleased with the Alienware m17x R3, although it is on the heavy side when it comes to commuting with the laptop in my bag.

 

Recovering a “Suspect” Database in SQL Server 2008

Today I broke my SharePoint development environment by shutting down the SQL Server forcibly and corrupting my transaction logs, making the databases show in Management Studio show as “Suspect”. Thankfully this was a development environment and not our live environment! After a lot of googling and perseverance, I managed to cobble together a solution to get my databases back online and continue to work.

The best way to recover from this issue is to restore from a Backup. Stupidly I didn’t have a good backup available for the databases in my Dev environment.

I DO NOT recommend this method on a live system!!!

To recover the database, which involves rebuilding the transaction log I executed the following query in Management Studio. Obviously change the database name to reflect your own database name.

USE master
GO
ALTER DATABASE [DB_Name] SET EMERGENCY
GO
ALTER DATABASE [DB_Name] SET SINGLE_USER;
GO
DBCC CHECKDB ([DB_Name], REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS;
GO
ALTER DATABASE [DB_Name] SET ONLINE;
GO
ALTER DATABASE [DB_Name] SET MULTI_USER;
GO

Again I stress, DO NOT sue this method on a live environment.

Fullscreen flash videos freezing in Ubuntu 10.10

What’s up guys? I know its been a while since I posted anything… My baby boy Jake Daniel is here now though and he’s lush!!!

So a few weeks ago I decided to install Ubuntu on my laptop and virtualise Windows 7 in virtualbox. All went well except for one little bug that is highly annoying… Flash videos freeze or hang when they are opened in fullscreen mode.

After lots of googling and a few broken fixes, I have found this to be the most effective way of fixing this problem.


sudo mkdir /etc/adobe
sudo echo "OverrideGPUValidation = 1" >> /etc/adobe/mms.cfg

Apparently this is down to flash trying to use hardware acceloration and failing miserably, like flash tends to do anyway.

Well there you have it, hopefully this will help some of you out.