Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Tuesday, September 20, 2011

Hands on Labs for SharePoint and Lync

[Update 7/12/2011: Found two more Lync Labs and added them to the list]

Often when I teach a course students feel overwhelmed by the sheer amount of information bombarding them in just five days. Obviously the best medicine is to go over the books when they have had a chance to breathe and digest all the great new things they have learnt. But the best way to learn is not to read about it but do it! No, I can't give my students copies of the lab servers to play with at home. And no, you should not repeat the exercises on your production SharePoint farms. Luckily there is a simple answer to this dilemma. It is called Virtual Labs.
The boys and girls at Microsoft have put a tremendous amount of effort and resources into creating lab environments which anybody can use to gain invaluable skills with the SharePoint products. The labs are split into two main audience groups. Administrators and Developers. While the administrators will be able to get their juice from Technet the developers can get their labs from MSDN. Below is a compilation of labs which I think you will find quite useful. (Lync labs at the end of the article)


TechNet Virtual Labs for SharePoint 2010 Administrators

  • TechNet Virtual Lab: Backup and Restore in SharePoint Server 2010 - After completing this lab, you will be better able to use farm-level backup and restore features in Microsoft® SharePoint® Server 2010, use granular backup and content recovery tools in SharePoint Server 2010, and use Microsoft Windows® PowerShellTM to restore sites and lists in SharePoint Server 2010
  • TechNet Virtual Lab: Business Connectivity Services - After completing this lab, you will be better able to create an External Content Type based on a back end database and view and manipulate backend data in External Lists
  • TechNet Virtual Lab: Business Continuity Management in SharePoint Server 2010 - After completing this lab, you will be better able to configure and use the versioning features in Microsoft® SharePoint® Server 2010, configure and use the SharePoint Server 2010 Recycle Bins, and use Microsoft Windows® PowerShellTM cmdlets to perform backup and restore operations in the SharePoint 2010 Management Shell
  • TechNet Virtual Lab: Configuring Remote Blob Storage FILESTREAM Provider for SharePoint Server 2010- After completing this lab, you will be better able to enable FILESTREAM on the appropriate SQL Server database, provision the RBS data store, install the Remote Blob Storage (RBS) FILESTREAM Provider, enable the RBS FILESTREAM Provider on the appropriate content database, and configure the RBS FILESTREAM Provider scenario
  • TechNet Virtual Lab: Configuring Tenant Administration on SharePoint Server 2010 - After completing this lab, you will be better able to create a new Tenant Administration site collection, manage site collections through Tenant Administration, and create a partitioned service application
  • TechNet Virtual Lab: Configuring User Profile Synchronization in SharePoint Server 2010 - After completing this lab, you will be better able to configure the User Profile Synchronization Service in Microsoft® SharePoint® Server 2010, start the User Profile Synchronization Service, create a New Profile Synchronization Connection, edit Profile Synchronization Connection Filters, map User Profile Properties, and configure Profile Synchronization Settings
  • TechNet Virtual Lab: Enterprise Search - After completing this lab, you will be better able to create a new content source for SharePoint to crawl, exclude certain results from being crawled by search, create a Search Center, and customize and extend the user interface
  • TechNet Virtual Lab: Introduction to Microsoft SharePoint Server 2010 Upgrade - After completing this lab, you will be better able to verify existing 2007 farm and content upgrade readiness through the use of the 2007 pre-upgrade checker command, verify existing 2010 farm readiness to upgrade specific content databases using the 2010 Test-SPContentDatabase cmdlet, initiate upgrade for individual content databases using the 2010 STSADM -o addcontentdb command, review the upgrade session status using the improved Central Administration web site Upgrade Status page, initiate upgrade for multiple individual content databases using multiple PowerShell sessions to trigger parallel upgrade sessions, troubleshoot an upgrade failure due to missing features, and how to restart upgrade for individual content database, and use Visual Upgrade features to switch sites from the 2007 product look and feel to the new 2010 product user interface
  • TechNet Virtual Lab: New IT Pro Features in SharePoint Server 2010 - After completing this lab, you will be better able to find your way around the Microsoft® SharePoint® Server 2010 Central Administration Web site, use basic site management tools in SharePoint Server 2010, describe the health monitoring and Web analytics capabilities of SharePoint Server 2010, provide and consume SharePoint Server 2010 service applications, and use commands from the Microsoft Windows® PowerShellTM command-line interface in the SharePoint 2010 Management Shell
  • TechNet Virtual Lab: Performance Management - After completing this lab, you will be better able to set limitations on the number of list items returned at a time, understand how large list limits affect users, configure Resource Throttling, and understand how Resource Throttling and HTTP Request Monitoring and Throttling affect SharePoint performance and user experience
  • TechNet Virtual Lab: PowerShell and SharePoint 2010 - After completing this lab, you will be better able to find your way around the SharePoint 2010 Management Shell and interact with SharePoint Web applications, site collections, and sites, use Windows PowerShell scripting techniques such as pipes, filters, wildcards, and enumerations for SharePoint Server 2010 administration. You will also be better able to explain how to create and assign variables and use the SharePoint object model from Windows PowerShell
  • TechNet Virtual Lab: SharePoint Designer for IT Pros - After completing this lab, you will be better able to create and modify lists on the SharePoint site, create and modify workflows, and save SharePoint site as reusable template
  • TechNet Virtual Lab: SharePoint RTM - IT PRO - Business Continuity Management - After completing this lab, you will be better able to navigate through an unattached SharePoint Content Database, export content from an unattached SharePoint Content Database, and import previously exported content
  • TechNet Virtual Lab: SharePoint RTM - IT PRO - Installing and Configuring - After completing this lab, you will be better able to successfully install and configure SharePoint Server 2010, create a Managed Account in Central Administration, create a Web Application in Central Administration, and also create a Site Collection within the Web Application
  • TechNet Virtual Lab: SharePoint RTM - IT PRO - Service Applications - After completing this lab, you will be better able to configure the new Managed Metadata Service Application, associate the Managed Metadata Service Application with a web application, manage the Metadata Service by adding your own custom groups and term sets, import a group into the Enterprise Term Store within the metadata service, utilize the Managed Metadata Service Application within a list, configure My Site settings, and create a My Site
  • TechNet Virtual Lab: SharePoint RTM - IT PRO - Upgrade - After completing this lab, you will be better able to verify existing 2007 farm and content upgrade readiness through the use of the 2007 pre-upgrade checker command, verify existing 2010 farm readiness to upgrade specific content databases using the 2010 Test-SPContentDatabase cmdlet, initiate upgrade for individual content databases using the 2010 STSADM -o addcontentdb command, review the upgrade session status using the improved Central Administration web site Upgrade Status page, initiate upgrade for multiple individual content databases using multiple PowerShell sessions to trigger parallel upgrade sessions, troubleshoot an upgrade failure due to missing features and know how to restart upgrade for individual content database, and use Visual Upgrade features to switch sites from the 2007 product look and feel to the new 2010 product user interface
  • TechNet Virtual Lab: Windows PowerShell in SharePoint Server 2010 - After completing this lab, you will be better able to find your way around the SharePoint 2010 Management Shell and interact with SharePoint Web applications, site collections, and sites, use Windows PowerShell scripting techniques, such as pipes, filters, wildcards, and enumerations, for SharePoint Server 2010 administration, and explain how to create and assign variables and use the SharePoint object model from Windows PowerShell

SharePoint Server 2010 Virtual Labs for Developers

  • MSDN Virtual Lab: Client Object Model - After completing this lab, you will be better able to retrieve lists, print a list, and use ADO.NET data services
  • MSDN Virtual Lab: Customizing MySites - In this lab you will work with some of the new events capabilities in SharePoint Server 2010 as well as the new Visual Studio 2010 SharePoint Tools. You will customize public my site by adding new public page, which can host any additional services exposed for my site end users, create stapled features to customize structures created in personal my site using Visual Studio 2010, and also create delegation control to customize top navigation and web parts, which exists by default in the personal my site
  • MSDN Virtual Lab: Designing Lists and Schemas - In this lab you will work with some of the new events capabilities in Windows SharePoint Services 14 as well as the new Visual Studio 2010 SharePoint Tools. You will create a custom list definition, template and instance using Visual Studio 2010, implement referential integrity between two SharePoint lists so that items in one list cannot be deleted until referenced items in a child list are removed first, and create a synchronous event receiver that is triggered when new task is created
  • MSDN Virtual Lab: Developing a BCS External Content Type with Visual Studio 2010 - After completing this lab, you will be better able to build a BCS External content type, create a Business Data Catalog Model project, configure the External Content Type for offline use, and open the list using Outlook
  • MSDN Virtual Lab: Developing a Sandboxed Solution with Web Parts - In this lab you will construct a basic Web Part that will call into the SharePoint API to retrieve some information. Next it will try and use SPSecurity to try to elevate privileges. The third and last action that is added is an attempt to initiate a HTTP connection to an external site
  • MSDN Virtual Lab: Developing a Visual Web Part in Visual Studio 2010 - After completing this lab, you will be better able to work with existing Web Parts and Linq and also you will be more familiar with connecting two web parts
  • MSDN Virtual Lab: Developing Business Intelligence Applications - After completing this lab, you will be better able to use the Chart Web Part to create graphical representations of data within SharePoint lists, use Microsoft Excel 2010 to examine and data from SQL Server Analysis Services, and publish an Excel workbook with Excel Services to make it accessible to users using a browser. You will also be able to work with a PerformancePoint Services site and the new Dashboard Designer
  • MSDN Virtual Lab: Enterprise Content Management - In this lab you will work with some of the new capabilities added to SharePoint Server 2010 in the area of Enterprise Content Management. You will verify the configuration of an Managed Metadata in a SharePoint Web application, customize the Managed Metadata term store and leverage it within an existing SharePoint site, and implement document sets
  • MSDN Virtual Lab: Getting Started with SharePoint 2010 - In this lab you will begin your work with SharePoint 2010 and become familiar with the Virtual Machine (VM) that you will be using. You will get experience working with the SharePoint 2010 Central Administration site as well as working with a standard team site. This will allow you to experience the new user interface concepts introduced in SharePoint 2010 such as the server-side ribbon and in-place item editing. You will also get a chance to write and test C# code using the SharePoint Foundation 2010 object model
  • MSDN Virtual Lab: LINQ to SharePoint 2010 - In this lab you will create lists for use with LINQ, and create a web part for accessing the list data using LINQ
  • MSDN Virtual Lab: SharePoint 2010 User Interface Advancements - After completing this lab, you will be better able to create and customize SharePoint 2010 lists for storing ideas for new toys, and use various new features of SharePoint, SharePoint Designer and InfoPath
  • MSDN Virtual Lab: Visual Studio SharePoint Tools - In the lab you will become familiar with the standard project structure used by SharePoint Tools, create and test a project that contains a Feature, a Feature Receiver and a Web Part, configure SharePoint Tools deployment options, and debug a SharePoint Tools project by single-stepping through the code in your solution
  • MSDN Virtual Lab: Workflow - After completing this lab, you will be better able to use Visio to create the high level process, export the Visio model to SharePoint Designer 2010, and use SharePoint Designer 2010 to complete the detail. You will also be able to export from SharePoint Designer 2010 to a WSP file and import the WSP file into Visual Studio 2010

Virtual Labs for Lync 2010 Developers


TechNet Virtual Labs for Lync 2010 Administrators


Monday, September 19, 2011

Using Office 365 in an Extranet Scenario

This is something that has been one of the most exciting aspects of Office 365 for me. The fast and effective way of creating an Extranet scenario without the need to worry about firewalls, external user accounts or certificates.
When you sign up with Office 365 on an Enterprise plan you get access to your SharePoint Admin control panel. (Sorry folks, the Small business version aka Professional Plan does not have this feature)
There you can create several site collections and even allow external user which have not been set up in your AD or on Office 365 to access your SharePoint sites.
This is great news for companies who work closely with clients and want to use the SharePoint Online part of Office 365 as a information sharing hub.
When you open your first SharePoint team site at :https://youcompanyname.sharepoint.com" as administrator you will notice a new Site Action menu item called "Share Site". This is where you can add users as Visitor or Member to your site or sub site. You will also notice that this does not seem to work for external users straight away. You first need to change two settings for externals to gain access.

  1. On the SharePoint Administration page accessible via https://portal.microsoftonline.com/admin/default.aspx you will find a button that says Settings. Use this button to enable external access for your whole account. 
  2. Then go to the Site Settings of your private site collection via the Site Actions menu and activate the External User Invitations feature under Site Collection Features.

That's it folks. From now on you can add any email address to the Share Site dialog and that person will receive an invitation email to connect to your SharePoint site.
Using what username and password you might ask? Windows Live ID solves this problem for us. This part of Office 365 integrates via federation with Windows Live ID and so the external user can either use their existing Windows Live ID or sign up for a new one.
Once the user has signed in with their Live ID, they will appear in the group that you have added them to. Not any sooner though. They will also appear with their Live ID email which might be different from the email address you sent the invitation to. So before you get a heart attack thinking you got hacked by some random person, double check the email if it does not belong to someone you know who favours cryptic email addresses.

Happy Sharing!

Saturday, June 4, 2011

Introduction to SharePoint Information Architecture

It is my pleasure to announce the newest course offering by Equinox in Wellington:
http://www.equinox.co.nz/training/Pages/CourseDescriptions/sharepoint-information-architecture-introduction.aspx
I've teamed up with Equinox to deliver three SharePoint Information Architecture courses in Wellington. A one day introduction which covers the basics of IA as well as the basics of SharePoint. A two day course which then goes into the depths of creating taxonomies and hierarchies in SharePoint which can withstand the test of time. Finishing off with an advanced course which covers records management, governance, scalability and other advanced concepts over another two days.
I've been spending many hours online and in libraries prepping the contents of the introduction course and while I will be demystifing some SharePoint myths during the course I also am looking forward to the interactive sessions with the students. IA simply is not something you can learn by listening to speeches or watching viedos. It really only sinks in when you do it for real, so expect some fun and enlightening hands on session to drive home the concepts learnt!

We'll be running the course on June 22nd. Places are limited; so make sure you book your place soon to avoid disappointment!
http://www.equinox.co.nz/training/Pages/CourseDescriptions/sharepoint-information-architecture-introduction.aspx

Expired Virtual Machines for 10232

Thank God, Microsoft Learning is fixing the date issue on the 10232 virtual machines. Looks like this time they didn't get away with "it is not broken, it is by design". So if you are planning on teaching Advanced SharePoint Development techniques any time soon, then make sure to get your hands on the newest images. They should be online within the next week or so.
Btw, 10232 is full of theory and "best practice" concepts. Great for solution architects, team leads and senior developers. Not really the stuff junior SharePoint developers are keen on. They just want to get their hands dirty coding WebParts.
Also, encourage the client to send their newbie SharePoint developers onto 10174 first before visiting any of the advanced courses. Although it is an admin focussed course it covers all the essentials which a developer needs to know about.

Thursday, April 21, 2011

MCT Tips and Tricks for 10232

Fellow MCTs,
I am posting this for the benefit of those MCTs who have not figured out that there is a whole wiki page at http://borntolearn.mslearn.net on this course once you log in with your MCT LiveID account.

10232 was built with a trial key for SharePoint that has a fixed expiry date. You must turn the clock back to August 2010 (tested using 10th and 11th/08) to teach this course. Thanks go to Chris Barker for being the first to post a solution to this problem at the MCT forum. The key to getting the course to run is to set the clock of the host back before importing the VM and starting it up. This is due to the host setting the bios date of the vm on initial bootup. So changing the time after the fact in the vm does not help as the SharePoint key has invalidated itself by then.
BUT...
When setting the clock back to a date before the host was built you might have troubles getting any vm to start with a certificate failure. This is due to a certificate HyperV uses when initialising the VM. To solve the problem you need to delete the self-signed cert and reboot the machine. That will force Hyper-V to recreate the cert at the older date and the VMs will start. To do this follow these steps:
1) open MMC and add the Certifcates Snap-in
2) Select the service account option
3) Pick the HyperV Virtual Machine Manager service
4) drill down into the own Certificate folder (first folder)
5) delete the self signed cert with the machine name
6) reboot

Last Tips for a smooth running course:
Configure the machine to use an internal network so you can remote into the box from the host. That will make copy and paste much easier and also allows you to put fiddler on the machines. (my students loved seeing fiddler in action and could not stop fiddling with it)
Change the Integration settings for the vm to not synch the time. That will stop the host from updating the time in the VM. This does not work on initial boot, as the initial time and date on first start of the vm will always be set based on the current host regardless of that setting. But it should prevent the machine to take on a new date while it is running.
Then make a Snapshot!!!
Should the student have changed the time on the host during the course and the time did synch due to some fluke, you can easily revert back to the snapshot which has the correct time settings and a functioning SharePoint instance.

Happy teaching!

Wednesday, April 20, 2011

SharePoint Diagnostics Studio V2.0

This will be one of the most anticipated admin and dev tools released for SharePoint this year. It will come bundled with the updated version of the administrator toolkit for SharePoint 2010.
Ever had to trawl through multiple logs from multiple load balanced servers to figure out what really happened? Wished you could have your perfmon counters ready when analysing problems? The next version of the SPDiag tool will let you do that and much more. Run reports, save report snapshots, find events based on time, CorrelationID and... the login name! So Jo complains his page crashed and he did not make not of the correlation id? No problem. correlate all logs into one place on your desktop with minimal strain on the servers. Then run a search on his logon and the time window when it crashed and you'll have all the surrounding details, processes and counters available at your fingertips.
Also includes database stats, network stats and latency statistics to identify bottlenecks with some of you service app communications.
This tool was developed by the product team at Microsoft to assist them with the SharePoint development process. What's good for them can't be bad for us mere mortals!
Can't wait to get my hands on this gem. Supposedly coming out this month. Which really means sometime this year, probably during Q2 some time.

Friday, March 18, 2011

How to Add Custom Columns to the Search Results in MOSS 2007

A few years ago I demonstrated at the New Zealand Conference how to add custom metadata columns to your search results. What I never did was make a blog post about it. So let me rectify that error of mine.

To get custom columns to appear on your search results page in MOSS you will need to do a few things. First make sure the metadata field is indexed and available by adding it to the Mapped Metadata Columns in the Search Administration of your SSP. Then, recrawl your index. And finally show the new column on the search results page by tweaking some xml and xsl.

1) Get the column indexed and mapped
To do this, open up your SSP admin site either directly or via Central Admin. Then navigate to the Search Administration Page and look for Managed Columns on the left menu. There you will need to add a new managed colum which mapps your custom field. This field could be in a SQL Store indexed via BCS or in a custom list or in a custom content type. In any case I assume that you have already crawled all the content in question, otherwise this step won't work.
2) Recrawl the index
Once you have added the managed metadata colum you need to do a full crawl. Sorry, no incremental crawls will work, as only in a full crawl does the engine do the mapping of all existing fields in the index.
3) Customise the Search Results
Browse to the search results page in your Search Centre. Fastest way? Type in a search into any search box! If you farm is configured correctly that should catapult you to the correct page.
There you need to edit the page and customise the Core Search Results WebPart.

Before you edit the actual XSL Look and feel you need to tell the webpart about the new column. So first click the three dots next to "Selected Columns". You find this option under the ResultsQuery Option. (refer to above screenshot) Copy the text out of the editor into notepad. You'll get this:
Well, you won't get that exactly. It will all be on one line and illegible. Feel free to use an xml editor of your choice instead of notepad.
In that xml you now need to add the Mapped Metadata column name. Make sure you use the correct case. XML is case sensitive! Also add the name you gave the mapped column and not the source metadata column (in case these two have different names). Once you have added the column to the xml text copy it back into the popup for the "Select Columns: option.

(note the new MyCustomColumn entry at the bottom)
Once you have added the xml for the new column you can add the column to the output in the XSLT.
Click the XSL Editor button on the WebPart customisation interface (see first screenshot) and add the new field to your xsl.

Extract before you add the markup:
And now with the new data appearing right next to the description of the search result:


That's it. Copy the changed xsl back into the XSL editor popup, apply your changes to the web part and test your results by executing a fresh search which includes some of the custom metadata that you have indexed.
The next step would be to create a custom scope for your BCD indexed data, create a custom search page and search results page for that scope and go ape-shit on the search results page with loads of custom columns and custom look and feel.
Happy Customising folks!

Monday, March 14, 2011

How to pass 70-576

Totally forgot to post the fourth post in the series. If you want to earn your sharepoint 2010 professional developer credential then you'll also need to pass this exam. Measureup does not have this one on it's books yet, so no legal cheating on this one.
The questions are not quite scenario based as with many of the .Net developer pro exams. But not quite as code driven as the TS exams. Expect simple scenarios with simple seeming answers.
Actually there are quite a few trick answers where there seems to be two valid choices until you spot the error. My best advice on this exam is to eliminate the wrong answers. Quite a few will be obvious bull answers, but there will be the occasional one that will make you doubt. Re-read the question. Often there is a clue or constraint in the mini scenario which will eliminate the second option.
A lot of questions are common sense on development and deployment techniques. Make sure you're up to scratch on best practices for features, solutions, dependencies, upgrading and the new 2010 features.
Warning! Only because it is a new feature in 2010 doesn't mean that it must be the right choice!
Last tip, as with any Microsoft exam, stick to your first gut choice when in doubt. And only move from that when you are 100% sure that the new answer is the correct one.



Tuesday, February 8, 2011

Enabling RBS on additional Databases

You'd think it to be really easy to find good information on enabling RBS for additional content databases out there. But if you landed on this blog post, then you were proven wrong, like so many others.
Actually it is not that hard.
Once you have followed all the instructions to set up RBS for the first time:
http://technet.microsoft.com/en-us/library/ee663474.aspx (SharePoint Foundation 2010)
http://technet.microsoft.com/en-us/library/ee748631.aspx (SharePoint Server 2010)
You then need to follow these steps for each additional ContentDB:
http://technet.microsoft.com/en-us/library/ee748641.aspx (Universal)

The important part in the last link is the different msi script. As you use different ADDLOCAL parameters.
Also keep in mind that if you are relying on the FILESTREAM Provider in SQL 2008 R2 you need not install RBS on the SQL Server itself, as it is supported by default. If you plan on using RBS using a third party Provider, then you will need to run the msi on the SQL Server too:
http://technet.microsoft.com/en-us/library/ff629463.aspx (SharePoint Server 2010 without FILESTREAM)

Happy Remote Blobbing!

Tuesday, February 1, 2011

Keeping Dead Wood out of SharePoint. Or, how to avoid Zombies.

In his article, What NOT to migrate into SharePoint Joel identifies the usual suspects of types of files which are not suited to be stored in SharePoint or any DMS system for that matter.

While Joel covers the what quite exquisitely, he does not cover the why from an IA point of view. I have seen companies throw hundred thousands of dollars at setting up SharePoint farms to store ALL their documents. Including massive investments in infrastructure and likewise projects required to design a stable and usable system with minimal change impact to the end users. But what they all forget to ask is the big WHY? Why migrate the content? Where is the business value? The standard answers you will get most of the time will go along the lines of “because with SharePoint we can manage the files better” “We then have versioning” “One central platform instead of disparate locations”. And that is when the headache begins. Dead documents are brought to life in SharePoint only for the sake of having one single source of truth. These zombie documents devour resources and money the instant they are resurrected and cause major maintenance headaches for all involved.

When the team of BAs and IAs are classifying all the documents they often skip the most important classification. Is this document still active or is it at the end of its life? Will there be any form of collaboration going on or will it only be used as reference material. If you can make that distinction you will easily be able to identify exactly which files need to move into a managed environment and which can stay in an unmanaged location. Many projects shy away from this question simply because it can be a daunting task. There might be millions of documents that need to be classified into active and non active. Also there is the problem of having separate locations for associated documents. This is where third party providers can come in extremely handy. While some offer Web Parts which will display existing file shares in SharePoint in a more integrated manner, they will lack the full functionality support of a SharePoint document library. So if you do not need versioning or SharePoint driven security, then have a look for Network Share Web Parts on http://www.sharepointreviews.com/ There are some web parts listed there.

If you on the other hand want to have versioning, SharePoint driven security, Check-in and out, then more complex solutions will be needed. Such as the File Share Library by bamboo solutions which synchronises a fileshare with a document library. The only downside is that files will start clogging up the database once they move from stale to active use. This way at least the databases will grow gradually over time as more and more documents are activated. The final solution I want to suggest is using the FileShare connector from AvePoint. They have designed a solution based on their popular EBS driven Storage Extender which keeps the file share separate from the database even once files are actively used and versioned in SharePoint. The magic lies in a hidden folder on the fileshare which is used to maintain the new versions of the files, as they progress through the lifecycle.

But beware! Only because the DBA need not worry about 5TB big content databases no more means nobody should. A well planned major and minor versioning strategy and user education is key in keeping the network storage from blowing out of proportions. So do yourself a favour and have a look at some tools on the market before needlessly resurrecting dead documents into SharePoint.

Saturday, May 15, 2010

Send To Email with Attachment

Sending emails with a Sharepoint document as an attachment is a commonly asked for feature in Sharepoint.
Although the mailto: link used to work with the attachment parameter, this has not been supported by Outlook for a long time. Why? because it would be too easy to attach viruses to emails that way. Outlook would have to download a file from the internet and add it to the message. The chance of malicious code injecting into the process is too risky as well as the chance to send infected files to friends and colleagues.

So what is the solution?

If you wish to extend the send to menu in SharePoint, you can create a feature with a custom action to add another link to the ECM (Context Menu) which opens up a custom application page which then allows the user to enter receiver, subject and body. The server then could send the email directly via the configured SMTP server.

But beware!
This should only be done in an intranet scenario where the sending user has been authenticated. Otherwise it could be abused for spamming purposes too easily

Saturday, May 1, 2010

SharePoint Memory Leak

Todd Carter has posted a great article on a nasty little memory leak in SharePoint which has the potential to blow into a huge memory consumption beast for servers which have a lot of traffic and long uptime.
http://todd-carter.com/post/2010/02/08/SharePointe28099s-Sasquatch-Memory-Leak.aspx
In his article he highlights a problem with the HttpApplicatinoException handling of Sharepoint and also posts a very simple and effective solution where he ensures the applicationdomain is treated like a singleton and circumvents tens of thousands of unneeded objects in memory.
Sasquatch-Memory Leak

Monday, March 22, 2010

Adding Rich Text from SharePoint to an Infopath Form

Problem Scenario:
You are trying to add the value from a Rich Text field from SharePoint to an Infopath form. This is a common scenario when trying to create custom Workflows in Visual Studio with Infopath Form support.

Symptoms:
Your Rich Text does not appear in the infopath form. Any text which is not marked up does not appear. Text outside of tags does appear.

Solution:
After some digging I figured that InfoPath requires the xhtml Namespace to be present for any data within a Rich Text field. After a lot of digging into XmlParsers, XMLNameSpaceManagers, XmlNameTables and the likes I found a very simple solution.
When passing the value over to the ExentedProperty in your Workflow, wrap the string with a div tag that has the xmlns='http://www.w3.org/1999/xhtml' attribute on it.

string htmlText = "<div xmlns='http://www.w3.org/1999/xhtml'>"
+ workflowProperties.Item.Title
+ "<br/>"
+ workflowProperties.Item["Body"]
+ "</div>";

TaskProperties.ExtendedProperties["Instructions"] = htmlText ;

Just one thing missing now. Infopath translates your valid xhtml and shows the actual tags. To solve this problem you will need to add some parsing to the load method of the form. Yes, that means that you will need to deploy some code with the form. But it's no biggie. Promise.
A fellow blogger has a great post on how to stop Infopath escaping the html
http://www.chrisbuchanan.ca/Blog/Lists/Posts/Post.aspx?ID=1


UPDATE!
So I thought I nailed it! Well, as long as you do not attempt to open that infopath form using infopath! As that will throw a security exception due to the underlying code. But hey! It's on the server you might say. Being hosted by Infopath Forms Server. Nobody would wanna open it in infopath anyway. Ha. Outlook 2007 does! So when your Outlook 2007 users hit the Edit this Task button, instead of getting a nice RichtText experience, they get a security error complaining about a missing digital signature.

Sorry folks. Back to the basics on this one. I'll just strip out all HTML before passing it to Infopath using Regular expressions. A nice one to achieve this is
string stripped = Regex.Replace(textBox1.Text,@"<(.|\n)*?>",string.Empty);

(found via weblogs.asp.net/rosherove/archive/2003/05/13/6963.aspx

Tuesday, January 19, 2010

SendEmailNotification not sending emails

This is a tough one. There could be a whole bunch of reasons why your workflow tasks are not sending the OOB emails when a task is assigned. Here are just a few symptoms and their solutions

1) No emails are being sent, not receiving alerts
-Check your SMTP settings in Central Administration. Under Operations you will find Outgoing Email Settings. Make sure that a valid SMTP server is entered there. Either your local machine is running the smtp service which means the local machine name should be there or you are using an external smtp server to send your emails

-Try to connect to the smtp server using telnet on port 25.
a) open up a command prompt
b) type in: telnet smtp.yourserver.com 25
c) If you can connect, type in EHLO or HELO. If any of those give you back useful message your SharePoint Server is able to communicate with your smtp server.
Try sending a test message via telnet:
EHLO
MAIL FROM:someemail@domain.com
RCPT TO:validemail@domain.com
DATA email body
Test email message
.

Done. Make sure to do the CRLF.CRLF bit to send of the message. If it arrives, then you can rest assured that no smtp server config or firewall is blocking your SharePoint server.

Still no emails?
Make sure that the Windows SharePoint Timer Service is set to automatic and is currently in a running state. If that service crashed, or if someone stops it, no jobs will run, including the task emails and alerts.

Still plum out of luck? (been flying too much Air New Zealand lately) Make sure that the user has an email address defined!!! This sounds simple but can be a bitch when using MOSS.
When using WSS, simply click the header where it says Welcome Dude and select Edit my Settings from the dropdown. Add the missing email.
If using MOSS, you will need to update your profile either using your MySite, but if that is not available, go to the SSP Admin site and edit the profile manually there. But beware! Those changes might take some time to trickle down to your different site collections. To speed up the process open a command on the server and type stsadm -o sync
That will kick start the profile sync bewteen the profile store in SSP and the UserInfo Lists in the different SharePoint Sites.

Problem: You still can not see your changes on the userdisp.aspx pages of your site collections. even after executing the sync command and waiting a few moments paitently.
Reason: the user you are looking at is in the system, but not set as active in SharePoint. The only way to activate a user in SP is for that user to log in and do stuff. like adding, editing or deleting list items or documents. So do some stuff and execute the sync command again. That should do the trick.


So now you can see the email address on the user profile page (userdisp.aspx) but still not receiving task emails for your custom workflow tasks...
Maybe you're just impatient. the timer job is set to run every 5 minutes. to speed this up you can change the frequency using stsadm -o setproperty
the property you're looking for is job-immediate-alerts
the value is "Every 1 minute between 0 and 59"
But set that property at your own risk. It will also affect alerts on the farm.



EMail is set, user is active, smtp is behaving and the Timer Service is running, but no emails from your custom workflow.

Solution: First test if you get emails for any OOB workflows like approval and Feedback. If so, then there is an issue with multiple applicaitons using the same task list. I found assigning a new Task list for my custom workflow resolved this issue and SharePoint would send out mails for new tasks as expected. This behaviour is often caused when sites are exported and imported using stsadm. Not all settings are correctly migrated causing this behaviour to crop up. Another reason to be wary of using the export and import functionality in SharePoint to migrate solutions...

Sunday, January 3, 2010

Showing Attachments in List Views

Came across this one for one of my custmers. Wants an ability to upload documents to a list item and then show the uploaded docuuments on the list view.
The solution here is to use Attachments and try to get them to show on the view. By default the Attachments field will only give back a true/false value of 0/1, which is only useful for highlighting the fact that there are attachments.
You can build SharePoint Controls into your views and the one you need to show all the attachments as links is the AttachmentField
<SharePoint:AttachmentsField
ControlMode="Display"
ItemId
="{@ID}"
FieldName="Attachments"
runat
="server"/>

The best place to put this control is in your dataviews. Either create one in SharePoint Designer from scratch or convert an existing view into a DataView through righ clicking it in SPD 2007 and choosing "convert to XSLT DataView". Once converted you can add the control to the page.
But beware. When creating it from scratch you will be missing the Namespace directive (xslns) which ensures that the xsl parser does not get confused with your ASP.NET code. Best bet here is to convert a view and have a look at all the xslns entries it puts in there. It will enlighten you.

Monday, December 21, 2009

SharePoint DataViews don’t work after site export and import

Frequently Found Problem (FFP):

When using stsadm –o export and stsadm –o import, or SharePoint Desiger backup/import site for that matter, you will find that many of your DataViews and DataForms stop working on the newly imported site. The pages are riddled with web part errors complaining about not being able to access the data source.

Cause
By default, DataViews aka DataForms use the unique GUID of the lists they refer to, to receive data. When re-importing your site, the system reassigns new GUIDs for all the lists but does not clean up all existing references.

Solutions
Not so fast and dirty:
Manually fix the GUIDS after the import. Best option here is to open up the pages which stopped working (Views, WebPart pages, New, Edit and Display Forms of customised lists) and look for the keyword ListID in the document. You will find between 1 and 4 occurrences (normally 3-4) closely followed by the GUID of the list or document library in question. Simply update this GUID to the new one (extracted from the URL of the list settings page of the list) and you’re back up and running

Faster and not quite so dirty:
Change the references from absolute GUID references to named references. Open the pages at fault and look for ListID again. But this time replace the actual occurrence with ListName and replace the GUID that follows with the actual name of the list. This is best done before you do the export, or even better right after you created the custom view so you don’t have to worry about it later again.

Fast and clean
Instead of using the OOB stsadm –o import command to import the data, use one of the wonderful stsadm extensions a guy called Gary Lapointe developed. Although not officially supported by Microsoft, you will find them used by the MS pros themselves in their solutions. (Just look at the AdventureWorks Sample Site package)
One of these is the gl-import2 command which allows you to retain the GUIDS when importing the data.
stsadm -o gl-import2 -url "http://localhost" -retainobjectidentity -filename exportpackage.cmp

Using the above command you do not need to worry about mucking with the Views and Forms in SharePoint Designer at all. Notice the added magic keyword of –retainobjectidentity.

Tuesday, October 6, 2009

Multiple Templates per Document Library

I recently got a typical FAQ in my inbox:
"I have set up a sharepoint document library which has a template associated with it, whereby when you create a new document by selecting "new" from the menu bar, the document opens using the associated template.
What I would like to know is, is it possible to associate multiple templates to a document library so that when creating a new document by selection "new", you are offered a choice of templates to use? I'm hoping this is possible!!!"

Nothing simpler than that. The magic word is called Content Types. Okay. Two words then.
You can associate one template with a document library and associate one template with a content type(CT). As soon as a document library(DL) has more than one content type associated with it you will get more than one option when hitting the little arrow next to the new button. Careful, hitting the "New" on the New button will always start up the default CT, which is the first in the list.
So what to do next? Go to the site where you want to use multiple templates and under Site Settings go to the Content Type Gallery. There you create a new CT based of the existing CT called "Document". Now under Advanced Settings of that CT you can upload a new template to use when the New action is chosen. Finally go to Settings page of the DL in quesiton and enable multiple CTs under Advanced Settings of that DL. That will bring up a new section on the Settings page called... "Content Types" where there is a link to add from existing CTs. using that link add your new CT to the list and you're done. You can add as many as you like, but beware, the list should not get too long or you will get usability problems.
One last tip. You can create new CTs at the root of your site collection or within an individual site. CTs are visible only to the site you created it in and all its sub sites. So creating it at the root makes it visible across the whole site collection, but creating it in a specific site will make sure it does not appear further up in the hierarchy or in any of the sibling sites. This can be handy when certain CTs only make sense for specific DLs or specific sites. It is a good idea though to sit down and have a good think about where these CTs could be used and plan ahead where to create them.

Monday, September 28, 2009

Busted! Importing Profiles from multiple organisational units in Active Directory

One big drawback of the way AD implements LDAP is the lack of support for querying on Organisaitonal Units. No matter what you try, you will hit a brick wall when trying something like OU=SharePoint or OU:SharePoint in a simple query. Even trying to access the value as a property of an AD object will fail as OUs are not stored as properties on objects but only form part of the hierarchy and not part of the metadata. So, when importing profiles into SharePoint, the only place where you can enter an OU is when you are selecting the datasource, before applying any filters. Which means only one single OU, right? Wrong. read the solution at SharePoint Mythbuster.com

Thursday, September 24, 2009

Busted: Customising the application.master

There are numerous articles out there about how to change the system master page. The one that all pages in the _layouts aka LAYOUTS folder use. In most cases they want to do this to enable a different datasource for the top navigation aka global navigation. The average rookie who is in charge of creating a site in MOSS using the publishing feature will stumble across this problem and start hacking away at either the original application.master, or even go and implement a custom http handler to exchange the application.master with a custom one on the fly. None of these approaches are best practice nor are they supported by MS. So is it impossible to fix without breaking the system? Not at all.
I've published a solution to www.sharepointmythbuster.com! It will allow you to replace the top navigation on the fly for all pages in the site collection, including those horrid system pages and application pages.

Wednesday, September 16, 2009

Gettting Started with SharePoint development

Microsoft put together ten labs for Developing on SharePoint and also provided a fully functional VPC for you to get started. Time for the image is running out, as it will expire on 30/09/09. So if you don't have your own SharePoint development environment and wish to have a look at what all the hype is about go and download the image quick

VPC Image:
http://www.microsoft.com/downloads/details.aspx?FamilyID=1beeac6f-2ea1-4769-9948-74a74bd604fa&DisplayLang=en

WSS Hands on Labs:
http://www.microsoft.com/downloads/details.aspx?familyid=B885DCE8-C93F-48AA-B798-4422FEBCC200&displaylang=en

Loads of Resources, Demos, and online Walkthroughs
http://www.microsoft.com/click/SharePointDeveloper/