Month: June 2010

Team Foundation Server 2010–Integrate With Existing SharePoint 2010 Farm

A company I was working at went to great lengths to set up a nice SharePoint 2010 farm, complete with high availability, disaster recovery and backups.  This is typical for production environments.  What was interesting is that the development team used TFS and because this was not a software shop, they were the red headed stepchild department with a single VM running TFS with SharePoint Portals and Reporting Services.  When you find yourself in that sort of situation, wouldn’t it be nice to be able to move your Portals to the farm and take advantage of the existing infrastructure...

Read More

SharePoint 2010–What Products are Installed on the Farm?

Sometimes when you walk into a new client site, they have what is documented and then they have reality.  Farms get patched, upgraded and various products installed and sometimes there’s no documentation about what actaully exists.  so first thing you want to do is see what you are dealing with.  Here’s some basic commands to see what’s going on. First, what products are you working with?  Using Powershell we can find out what products are installed on the farm: (get-spfarm).Products This will print out a list of SKU GUID values that you can compare against this list to see what is actually installed on the farm. BEED1F75-C398-4447-AEF1-E66E1F0DF91E: SharePoint Foundation 2010 1328E89E-7EC8-4F7E-809E-7E945796E511: Search Server Express 2010 B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0: SharePoint Server 2010 Standard Trial 3FDFBCC8-B3E4-4482-91FA-122C6432805C: SharePoint Server 2010 Standard 88BED06D-8C6B-4E62-AB01-546D6005FE97: SharePoint Server 2010 Enterprise Trial D5595F62-449B-4061-B0B2-0CBAD410BB51: SharePoint Server 2010 Enterprise BC4C1C97-9013-4033-A0DD-9DC9E6D6C887: Search Server 2010 Trial 08460AA2-A176-442C-BDCA-26928704D80B: Search Server 2010 84902853-59F6-4B20-BC7C-DE4F419FEFAD: Project Server 2010 Trial ED21638F-97FF-4A65-AD9B-6889B93065E2: Project Server 2010 926E4E17-087B-47D1-8BD7-91A394BC6196: Office Web Applications 2010 For example, when I run this on an SPFarm I am currently working on, I get the following results: And that tells me I have SharePoint Foundation 2010, SharePoint Server 2010 Enterprise, and Office Web Applications 2010 installed on the farm. To figure out what version of SP or CU the SPFarm has been patched to, simply run this command: (get-spfarm).BuildVersion And this will output the version of the...

Read More

SharePoint 2010 Profiles without mySites

Being able to import user profile information from a third party source like Active Directory is usually one of the most critical parts of a functioning Intranet site. What makes this even more powerful is when you layer on the ability for users to edit their own profile information, as well as search for other users. Layer on top of that the social networking features that My Sites provide, and you’ve got killer functionality. The problem, though, is that some companies want this functionality without actually using My Sites. (This can be for various reasons, usually revolving around governance;...

Read More

SharePoint | Add Alternating Row Background Colors to SharePoint Document Libraries with CEWP and JavaScript

SharePoint out of the box has some great tools for displaying documents located in a document library, probably because that’s what a lot of companies use it for.  Out of the box it looks pretty nice, however I had a request that besides having the view display the documents in the document library we also add conditional formatting to allow better visibility to separate the rows with background colors similar to how when we insert a table into a SharePoint page we can apply the a Style like “Table Style 2 – light banded” under Table Tools->Design->Styles to give a banded affect to the Document library, similar to the following: This would allow some of our older colleagues to very clearly follow the rows associated with each item.  Seemed pretty simple and I spent some time trying to find the property that would turn on this feature for the document library.  Turns out there wasn’t one, however with a little creative JavaScript and some quick peeks under the covers at the page source it’s actually very easy to accomplish! First, open the page you want to apply this style to, and view the source.  Now search for a table element with class="ms-listviewtable" and grab the id value, it should looks something like “onetidDoclibViewTbl0”, but if you’re using certain customized views might look more like “{GUID}-{GUID}”, for the most part...

Read More

SharePoint 2010-Updating User Profile Properties with PowerShell

PowerShell can be a lot of fun and quite powerful because you can script several functions together to create Admin and maintenance function that would take you days to do through the UI.  If I am an admin who has been granted the Manage Profiles right and Full Control in the permissions section of the UPS, I can do some pretty interesting things with a few basic scripts. For example, imagine that the company has just gone through a massive re-org and now we have a whole bunch of colleagues who have either changed their department or had their department renamed.  Imagine trying to do that for 50 colleagues through the UI, it is doable, but tedious.  Now imagine it was 500 colleagues or even 5000 colleagues.  This is where PowerShell can come in and really save the day. So, imagine we’re given a Comma Separated Values (CSV) file with the colleague NTID and Department Name and we need to update this information in SharePoint User Profiles. First step would be to check out the Import-CSV cmdlet ( http://technet.microsoft.com/en-us/library/ee176874.aspx ) Seems like this will work perfectly for our needs, so let’s start building up our script. I always load in the SharePoint PowerShell snapin: #First load the SharePoint commands add-PSSnapIn Microsoft.SharePoint.PowerShell Now we set up our Job variables, good coding says do this at the top so they are...

Read More

InfoPath 2010–Input Mask for Phone Numbers

InfoPath is a great tool when you need to collect data from the users, especially in SharePoint.  I especially like the browser enabled enhancements over the old 2007 and it’s a great way to spruce up the standard NewForm.aspx and EditForm.aspx pages when you want to put some logic and validation for what the user is inputting, for example phone numbers. From a basic standpoint, a phone number has to be entered in the format (123)555-7899. There is a way to make this happen – even in browser forms – using something called Regular Expressions (Which by they way if you don’t know about this stuff you should go check out the tutorials here at regular-expressions.info . You won’t see the phrase "regular expression" in InfoPath but you will see something like "matches pattern" or "does not match pattern" – which are regular expressions. Here’s the basic way they work: Using either Conditional Formatting or Data Validation in your InfoPath form, you should have [Field1] [Does not match pattern] [RegEx Pattern] – and the action or tooltip should either disable/hide the control or have a message stating something like "Please type your information in the correct format". Patterns use the following building blocks: If you want to have a symbol for any letter: \p{L} If you want to have a symbol for any character (letter, number, or symbol): ....

Read More