Skip to content

Category: Technology

Format an HTML Safe String using .NET

I’m posting this as much as a reminder to myself as anything. I infrequently find myself needing to make sure that a string is safe to use on the web in any number of scenarios. The .Net framework contains a function to do just that, but they’ve cleverly hidden it away in the security assembly. That’s why I needed to write this – I use it infrequently enough that I can never remember where it is.

To use it, just make a call to:

System.Security.SecurityElement.Escape("text to encode")

And that will do the trick "&" becomes “&amp;”, “<” becomes “&lt”;, etc.

Leave a Comment

Installation Considerations for Reporting Services in SharePoint Integrated Mode

Ever Since SQL Server 2005 R2, it has been possible (with varying degrees of difficulty) to tightly integrate Reporting Services with SharePoint. What this means is effectively discarding the management and user interfaces that come with a Reporting Services native mode installation, and managing and use all reporting through the SharePoint interface.

This has really nice benefits for those managing the Reporting Services environment, mainly because you can simply leverage your SharePoint storage and security infrastructure instead of having to create and maintain another one simply for reports. Users benefit from a consistent user experience, and are easily able to create filtered reports through the Report Viewer web part.

Integrated mode is however not without its complications, and with the release this week of SQL Server 2008 R2 (which includes some very nice Reporting enhancements), I thought that I’d go over them. Here are some of the more important moving parts:

  • Reporting Services Add-In must be installed on EACH front end web server in the farm
  • Reporting Services database must be created in SharePoint integrated mode
  • Anonymous access must be disabled for the target application
  • The machine hosting Reporting services must be a member of the SharePoint farm

If everything that you’re running is on a single server, you really don’t need to read any further. In that scenario, everything is straightforward. But if you’re not on a demo system, or you have more than 3 users, chances are that your farm is distributed, and least broken out into one Web Front End (WFE) and one SQL Server.

As I’ve mentioned previously,The Reporting Services add in now installs as a prerequisite with SharePoint 2010,which makes the first point a no brainer. However, if you have SharePoint 2007 and multiple web front ends (your query servers count), you need to install the add in. Also if you add a new Front End server down the road, don’t forget the add in.

If you’re currently have a Reporting Services server running in native mode, and you’re looking to upgrade to SharePoint Integrated mode, don’t expect an enjoyable experience. You can’t upgrade your existing native mode database to integrated mode, you’ll need to export everything, create a new database in integrated mode, and move everything into it. You can however switch back and forth on the server side if you need to, but as you do, it’s all or nothing.

One thing that I wanted to do was to take an election results analysis demo that I’ve recently done with SQL Server 2008 R2 mapping and expose it to the world. Unfortunately, that’s not going to be an option because you can’t run the application in anonymous mode with the plug in. If you have this requirement, then Integrated Mode is not for you.

Finally, the big requirement is that the machine running Reporting Services must be a member of the SharePoint farm. Typically you only install the SharePoint bits on the WFEs and the Index servers, and the SQL Server itself is left alone. Basic guidance from Microsoft indicates that now you need to install the SharePoint bits on the SQL server and then join the farm. This may be daunting to those that have yet to “enjoy” the challenges of running a multiple WFE farm. It also might be a particular challenge if you don’t “own” the SQL server itself.

My preference (typically, not always) is to take the other approach, and install Reporting Sevices itself (none of the other services, database engine, etc) on one of the SharePoint front end servers. In our case, we have a 3 server farm (one front end, one indexer/query/central admin, and one SQL, and Reporting Services is on the Indexer/query/central admin box (I need a better name for it).

In this scenario, the Reporting Services databases themselves still live on the main SQL server, but the services and rendering all happen from the WFE machine. This makes for a very low touch solution in terms of your SQL server, and is much easier to maintain. This model also also allows you to get going with the new features available in SSRS R2 without having to first upgrade your central SQL server.

One caveat – with 2007, I always found that it was a requirement to also run the Central Administration application on the machine with Reporting Services. I don’t know if that was a true limitation, or something that I was missing. I haven’t yet tried it using R2 and 2010, but when I do, I’ll come back here and update this. Also – if you know something I don’t, please feel free to enlighten me!

5 Comments

How to Completely Remove All Traces of Office 2010 From Your System

I’ve just made it through a pretty nasty problem with Office. I had been running the beta version, and had updated it to the RTM version available on MSDN. Yesterday I got a message saying that it was going to expire in 2 days. I tried changing my product key, but it wouldn’t accept my (legitimate) key. I did notice one odd thing that the version numbers were mismatched at various areas of the system – both 14.0.0460 and 14.0.0463 were showing. As it turns out, that had nothing to do with it, as this is expected behaviour, but I decided to do a full uninstall and reinstall.

After reinstalling, every one of my Office applications wanted to run through configuration every time they started. This problem, as it turns out is not new, and there are unfortunately many possible causes, and as many solutions. I tried many of them. I did have the registry permissions problem with HKEY_CLASSES, and walked through the solution outlined here. It helped me with OneNote and Outlook, but Word and Excel were still problems. Uninstalling and reinstalling (multiple times) didn’t help at all.

Luckily,(for me) a colleague had some really nasty problems last year that required him completely removing Office 2007 from his computer. After speaking with Microsoft support,he received a utility that was to do the job, and it worked well.  I thought I’d give it a whirl. Unfortunately, it only wiped 2007 not 2010, but luckily, it’s a vbs file and therefore editable.

After removing all 2007 and 2010 applications from control panel, I ran the 2007 utility, which found and removed lots of stuff. I copied the file and then edited it to be relevant for Office 2010. I then ran it, and it did its magic, with a few errors related to the removal of unrelated temp files. A reboot, a reinstall, and I’m up and running again. Nice – I wasn’t looking forward to the idea of repaving my system.

I”ve included both of these removal utilities here.  No warranties are expressed or implied, they may help or hurt,  they may make your system catch on fire, and if they do, don’t blame me. All I can say is that they worked really well for me.

143 Comments

Truly Great Software – JRiver Media Center

Anyone that knows me knows that I like my media. Books, music, movies, you name it, and the more that I can get digitally, the better. Years ago, when I was amassing MP3 files at a pretty good clip, it became pretty obvious that I was going to need a good tool to keep them organized. I used a few tools, and then happened upon a product from JRiver called Media Jukebox that completely fit the bill, and I pounced on it. At the time, it was Version 8.

Over the years, my requirements changed,and the product changed along with me,becoming renamed Media Center for its version 11 release. I started using lossless files, and lossless support was added. Digital photos became a big deal, and they offered incredible support for digital pictures. I acquired a portable music player, and of course sync support for that was baked right in, along with excellent support for podcasts, both audio and video.

I originally gravitated to Media Center as a tagging tool. It makes tagging music, images, movies, whatever a breeze, adhering to all published standards while allowing you to extend its schema as you see fit. However, it’s also a full featured player. While some of the other market players are just figuring out a client/server model, I’ve been able to stream content from my collection at home to my JRiver client since 2003, simply by turning on its Media Server feature.

In the current version, it can do not only that, but you can control your player using and browser enabled device, or ever stream music straight to a handheld device using only that devices built in tools to play the stream. It’s also a fully fledged DLNA (the successor to UPnP) device, both as a client and a server.

I recently began a project of getting my photos tagged and organized, and shared out to the web. I of course turned to Media Center, which has not let me down. Not only can I leverage its powerful tagging features, but it also allows sharing out to social networking sites like Facebook and Flickr, or online storage systems like Gallery, and they even host a photo sharing server should you wish to use that. All of the photos posted to my Flickr account get their through Media Center, with all keywords intact.

To underscore all of this, I bought my son an iPod Touch for Christmas. I was a little shocked to learn that I was FORCED to install and use iTunes in order to even turn this thing on. Once done, I was struck with how limited and limiting it was. Surely Apple, the “king” of UI could come up with a decent experience. The device itself is fine, but about half of my collection is rendered useless. Why? Because about half of my collection uses the standard FLAC file format which iTunes doesn’t support.

I have an iPod Classic 160 GB that’s never seen iTunes – it’s the way I like it. JRiver’s iPod support is unparalleled (they can’t support the iPod touch or the iPhone because Apple won’t let them). It syncs both my audio and video, no matter what the format with ease, and gives me a complete set of options for auto conversion, including which encoders to use, and how to do the conversion. My synchronization lists are my playlists so I don’t even need to think about it – it just works.

Finally, I can output to more than one sound card simultaneously. In my case, I have a Russound 6.6 distributed sound system. Which distributes audio through the house. Two of the Russound inputs are fed from Media Center, which has a “his” and “her” zone set up. Another zone is set to play in the main living room. Everyone is happy…..

Support is also fantastic. They use a discussion board for this purpose, and you often get answers to questions within the day, either from JRiver staff, or by other users. It’s also an avenue for feature requests. When the library server was in development I wound up in a fair bit of back and forth with their engineer who ultimately implemented everything that I needed to make it work.

It does all of this for a price tag of $50. I honestly don’t know how they make this viable as a software company, but I’m really glad that they do. It’s really my Swiss Army knife of media tools. I strongly urge you to visit their web site and give it a try. They have a fully functional 30 day try and buy program. If you try it, you’ll but it.

Leave a Comment

Configuring Profile Import in SharePoint 2010 – A Way Around the Minefields

Author’s Note – July 17 2012. When I originally wrote this in early 2010 it was based on some (at the time) sketchy Technet documentation and experience. It was meant to be an easy to understand guide to setting up the User Profile Service. I want to point out that there is a much more comprehensive guide out there on the topic, the Rational Guide to the User Profile Service by Spencer Harbar. It’s the reference I use when I get into trouble, and if this article doesn’t do it for you, I recommend going there.

Profile synchronization has changed drastically in SharePoint 2010 compared to 2007. The 2010 profile synchronization uses the Forefront Identity Management services. There are a lot of good things about this, one of which is that it provides for bi-directional synchronization. User changes to their profile store can be synchronized back to their identity store (Active directory, etc). This of course can be tightly controlled, on a field by field basis. There’s a great post on how to do so here.

Of course, all of this added power is not without its cost in complexity. I had a great deal of trouble even getting profile imports to work at all with some of the pre-release builds, and the final release is still a little rough around the edges. There is a Technet document available here that details precisely how to configure profile imports. It’s completely accurate, but doesn’t necessarily answer all of your questions. This post is my attempt to help guide around the worst of the thorns, and get it working with Active Directory.

First, you’ll need to have a Profile application running. If you’ve done a migration, you already do. If you’ve run the setup wizard, and selected user profile application, you also already have one. Synchronization will however not be happening,even if you’ve done a migration. It will need to be configured.

If you don’t already have a Profile Service application,you’ll need to create one. You do that from the Manage Service Applications screen and choose the New button in the upper left. You’ll want to select “User Profile Service Application”.

New User Profile Service

There is a lot of configuration here, make sure that you scroll to the bottom and fill out all of the relevant options. You’ll be choosing databases for social tagging, a database for storing user profiles, a database for storing user tags, and the URL of your MySite Host. If you haven’t already created a MySite site collection, the configuration screen here will allow you to do so. Once you have successfully created the application, you may then proceed to starting the service. This of course is in a completely different are where the services on the server are controlled. Once there, start the User Profile Synchronization Service.

User Profile Synchronization Service

When you start most of the services, they either start immediately, or give you a configuration screen and start quickly thereafter. Clicking this one gives you the configuration screen where you’re prompted to associate the service with your application from above, and the credentials that the two Windows Service accounts will run with. However once completed, you’ll notice that the service is in a “starting state”. This is normally a bad thing with SharePoint, and indicates that something is hung. Not so in this case. It takes a very long time for this service to start. When it does, you should see the following two services started:

New Profile Import Services

DO NOT attempt to start these services manually, and that will confuse the system in a very big way. Just have patience, and all should be well. You should now be ready to go ahead and perform an import. However, there’s a very import step that likely needs to be performed. The service account that was specified above to run the synchronization service (the one that the two forefront services are running as) need to be granted the “replicating directory changes” permission. There is another Technet article on how to do this, so I won’t go into detail on how.

If you do not perform this step, your import will fail, and you’ll have very little idea as to why. The error message is far from clear. Below I’ll talk a little about how you can troubleshoot import issues.

The next step is to set up the import itself. To do this, open up or manage your Profile service application, and select “Configure Synchronization Connections”

Create New Profile Connection

Once here, you either edit your existing connection(s), or create a new one. The options for import source are greatly increased from 2007 and now include Active Directory, Active Directory Resource (ADAM), Active Directory Logon Data,  BDC (they’ve forgotten to rename it to BCS), IBM Tivoli, Novell eDirectory, or Sun Java System Directory Server. Another improvement in this version is that the import can now use Forms authentication credentials, but can also make use of Claims based authentication if available.

Give the connection a name, select an authentication type, and any appropriate credentials. Once you have done this, press the “Populate Containers” button. If everything is OK, you should see your import source appear below:

Profile Import Container Selection

This dialog is NOT particularly responsive, be prepared for long waits between mouse clicks. The beauty of it is that you can now very easily cherry pick which containers, and even users get imported very easily. This is not something that was straightforward in 2007. Once completed, select OK, and your connection should be created. Note – subsequent edits of the connection will not retain the credential information. This is normal.

At this point you are ready to perform your firs import. Return to the Profile Service Application main page, and in the Synchronization section, select “Start Profile Synchronization”. You then have the option to choose full or incremental sync. Once selected, synchronization runs, and you can keep track of its status on the main profile application screen:

User Profile Service Application with import job running

The import job will take a very long time, compared to import jobs in 2007. The good news is that the status messages are relatively verbose. If however, you feel that the job is taking too long, and you feel that there is a problem and can’t locate it, an excellent tool to use is the Forefront Identity Synchronization Manager Client UI. THis will be installed on your server at:

<install Drive>:Program FilesMicrosoft Office Servers14.0Synchronization ServiceUIShell and the application to run is miisclient.exe. This application is installed by default, but there is no entry in the start menu. Running this file will give you a screen that looks like the following:

Profile Synchronization Manager Client for SharePoint 2010

This screen shows no problems, but if there are, they will be displayed for each step in a great amount of detail. I’ve used it to troubleshoot a few connection issues already.

In conclusion, the new profile synchronization system in 2010 has quite a few more moving parts, is a little rough around the edges (at the moment), and can be a bit of a bear to get going. However, it’s new capabilities make it well worth the effort, and lay the groundwork for what I can see to be some great new features down the road.

11 Comments