Wednesday, December 15, 2010

Moving a Records Center: Bad Idea

Moving a SharePoint 2010 records center will cause several issues of varying significance.

Document Management Implications:

  • If you have a custom Send To location allowing users to submit documents to the record center, this URL will need to be updated
    • A simple change
  • If your Send To location leaves a reference to the file in the original location, this will be broken:image
    • When clicking on the file reference you will see an error message “File not found”
    • This is irreversible

Records Center Implications:

  • All content organizer rules will have incorrect URL’s to the destination library, so these all need to be updated
    • A time consuming change if you have a lot of rules
  • Any document library/records library with retention schedules will be irreversibly broken in that you can no longer manage the schedule.  All libraries will need to be re-created, content migrated, and retention schedules added
    • The symptoms of this are detailed below in section “Broken Records Library Symptoms”
    • I have found no way to get around this other than recreating all libraries!!!
    • A very time consuming change if you have a lot of libraries, content, or complex retention schedules
    • Note: to delete record libraries you need to remove all records, then run the "Hold Processing and Reporting" timer job in Central Administration.  When this is complete, you can delete the records library.  Thanks to Michal Pisarek on MSDN for this one.

Broken Records Library Symptoms

When trying to manage the retention settings on the records library I see the error:

1. Click on Change source or configure library schedule:

manage the retention schedule

2. An error occurs:

error

3. And in the logs (nothing very helpful):

Exception Thrown: StartIndex cannot be less than zero.

Parameter name: startIndex Inner Exception: StartIndex cannot be less than zero.

Parameter name: startIndex

Recommendation

If you are using a single records center for managing retention, putting the records center in it’s own site collection is a good idea.  This also adds isolates the content from a security perspective.  You can always manually add links to the record center where necessary for people that need to access it from the main application.

Plan the Information Architecture up front – this one needs a good home from that start.

Tuesday, December 14, 2010

Delete document library option missing on settings page

You can’t delete a document library if it contains records.  This is a sensible feature considering that documents declared as records would logically have some retention requirement…

To delete:

  1. Undeclare your records or move them to another location
    1. If you’re working with a large document library with many folders etc. you could create a “Records View”, by filtering out any documents where the “Declared Record” field is not blank:
    2. image
    3. When all are deleted/moved, the delete option appears again in the settings page
  2. Delete the document library

Monday, November 15, 2010

PowerShell: file renaming en-masse

You may have come across the following error message when uploading files in SharePoint:
The file name is invalid or the file is empty. A file name cannot contain any of the following characters: \ / : * ? " < > | # { } % ~ &
But what if you have hundreds or thousands of files that DO include one or more symbols, and you need to move them onto SharePoint?
The following PowerShell script will replace a string in a filename with another string you provide.  It doesn’t alter file extensions or folders.  The script can be executed with command line parameters, however if they are not provided, it will prompt you for input.  The following parameters are used:
  • The directory e.g. “C:\test”
  • The text to find e.g. “&”
  • The replacement text e.g “and”
  • An optional switch that specifies whether to recurse through subfolders: –recurse
An example of how to use this script would be:
  • fileRenamer.ps1 “C:\test” “&” “and” –recurse
If you execute the script with no parameters, it will ask you to enter the directory, find, and replacement values in turn, but it won’t ask for whether you’d like to recurse.  It will default to non recursive.

Error Handling

The only issue this script handles is when the provisional new file name for a file already exists e.g. you are changing Q&A.doc to QandA.doc, and this filename is already in use.  In this instance, the script will notify the user that the rename operation has been cancelled and summary information is added to the end of the script.

Script Output

The script prints its progress to the console, and also provides some summary information at the end:
image

Disclaimer

Use at your own risk. I will not be held responsible for any actions and/or results this script may cause.  If you choose to use this script; test it first, and only run on directories/files with backups as the implications of renaming large numbers of files are serious and the operation cannot be undone.

The Code

Paste this into a new file and save it as “fileRenamer.ps1” or similar.
param(
    [switch]$recurse,
    [string]$directory = $(read-host "Please enter a directory"),
    [string]$find = $(read-host "Please enter a string to find"),
    [string]$replace = $(read-host "Please enter a replacement string")
)

# Startup text
echo "This script will replace words in files of any type.  It will not modify file extensions."
echo ""
echo "WARNING: This action cannot be undone; use at your own risk!"
echo ""

# Setup variables
$modifiedcounter = 0
$counter = 0
$exceptioncounter = 0
$exceptionfilenames = ""
$files = ""

echo "Replacing text '$find' with '$replace' in all filenames..."
echo ""

if ($recurse)
{
    # Grab all files recurse
    $files = get-childitem $directory -include *.* -recurse
}
else
{
    $files = get-childitem $directory *.*
}

foreach ($file in $files) {
    $filename = $file.Name
   
    # Only run if this is a file
    if ($filename.IndexOf('.') -gt 0)
    {
        $name_noextension = $filename.SubString(0, $filename.LastIndexOf('.'))
        $extension = $filename.SubString($filename.LastIndexOf('.'), $filename.Length-$filename.LastIndexOf('.'))

        echo ("Filename:          " + $file.FullName)
        #echo "Extension removed: $name_noextension"
        #echo "Extension:         $extension"
       
        # If there is a match then attempt to rename the file
        if ([regex]::IsMatch($name_noextension, ".*$find.*")) {
            # Change the filename
            $name_noextension = $name_noextension.Replace($find, $replace);
            $newname = $name_noextension += $extension
           
            #echo "New name:          $newname"

            # Test to see whether a file already exists
            if (Test-Path ($file.DirectoryName + "\" + $newname))
            {
                # A file already exists with that filename
                echo ("Action:            A file exists with the name " + ($file.DirectoryName + "\" + $newname) + " so this action has been cancelled.")
                $exceptioncounter++
                $exceptionfilenames += ($file.DirectoryName + "\" + $newname)
            }
            else
            {
                # Rename the file                
                rename-item $file.FullName -newname $newname
                echo "Action:            Filename modified from $filename to $newname."
                $modifiedcounter++
            }
        }
        else
        {
            echo "Action:            None";
        }   

        $counter++
    }
}

# Output the results
echo ""
echo "$modifiedcounter of $counter filenames modified."
echo "Exception count: $exceptioncounter"

# If there were exceptions then output that as well
if ($exceptioncounter -gt 0)
{
    echo ""
    echo "The following files were not modified as files already existed with their provisional new names:"
    echo $exceptionfilenames
}

Read-host "Press enter to quit"

Feedback

Please let me know if you spot any errors in this script or ways in which it could be improved!

Monday, November 8, 2010

SharePoint 2010: RSS settings missing in list settings page

When you view the list settings in the ribbon of a library or list, you may notice that the RSS Feed button is disabled:

image

You’re first port of call may be the List/Library settings page, where you would find the RSS settings link under the Communications area:

image

However, if this is missing, it’s likely that RSS is disabled at the site or site collection level.  Moving up the chain, if you view the site settings you might find an RSS link under Site Administration:

image

If this link is missing, try looking up at the site collection level, where there is another settings page allowing you to enable RSS for the whole site collection:

image

Enable this, then double check your site RSS settings, then you should have an enabled RSS button on your lists and libraries!

image

Wednesday, November 3, 2010

SharePoint 2010 Label Error: The Policy Label Configuration is Invalid

I’ve recently been working a lot around Information Management policies including Labels.  A Label Information Management policy allows you to add force Office users to add a label into a document such as Word or Excel. 
A label is composed of text and fields from your associated content type.  The requirement was to have the following format on the label:
  • {Protection Level} {Caveat}
After saving this policy, I opened a document of my content type in Word and was presented with the following message":
The Policy Label configuration is invalid.  Contact your Policy Administrator
image
Well it turns out you can’t format your label with two content type fields on the same line with only blank space characters in between – hopefully this will be improved in the next update…
The following does work as alternatives:
  • {Protection Level} – {Caveat} (a character in-between the two fields)
  • {Protection Level} \n {Caveat} (note this places the Caveat field on a new line)

Update

Well it turns out you can use the ASCII tab escape character "\t":
  • {Protection Level} \t {Caveat}

Wednesday, May 26, 2010

SharePoint 2010 New Features Overview

This post outlines some of the new features of SP2010 and the benefits they’ll bring from a business perspective.  The areas discussed are:

  • User Interface
  • Term Store
  • Search
  • Document Management
  • Workflow
  • Records Management
  • Social Networking
  • Business Connectivity Services (BCS)
  • SharePoint Workspace
  • Access and Visio Services
  • Large list Performance

User Interface

clip_image002

What are the new features?

  • The Office Ribbon is used everywhere including editing pages, list items and web parts.
  • Editing page and adding web parts is now WYSIWYG
  • Silverlight is used to enhance the user experience by reducing the number of page refreshes
  • New Silverlight controls used for embedding video and audio into a page

How will this help?

1. The much improved user interface will encourage collaboration and greater use of the site

Term Store

What is it?

  • A repository of terms and groups of terms that can be used to add meta-data to content

clip_image004

What are the features?

  • Build or import a taxonomy
  • Decentralized control of taxonomy
    • Assign ownership of areas of the taxonomy to different people/departments
  • Users can tag anything (pages, documents, list items) with one or many tags
    • Choice of tags available to the user can be filtered i.e. a document in the HR site can only be tagged with tags from the HR branch of the taxonomy
  • This feeds into search

How will this help?

1. Adding metadata to pages, documents or list items will allow users to categorize content with pre-defined terms

2. Find related content based on tags

3. Search results can be more targeted based on the metadata provided

Search

clip_image006

What are the new features?

  • Query syntax can be used
    • Query with AND, NOT and OR in your queries
  • Wildcards
    • Search with a wildcard at the end of your query e.g. share* will return SharePoint, shares etc.
  • Faceted search results
    • Results can be filtered and refined post query using facets identified from the search results
    • Examples of facets are author, meta-data tags, document type, and modified date
  • Federated results pull in people search results beside your standard search results
    • When you search for Marketing, you will see content related to marketing and people who are associated with marketing e.g. the marketing manager

How will this help?

1. Easier to find documents

2. Faster to find documents

3. Better introduction to related materials that might otherwise not have been located

Document Management

What are the new features?

  • Document sets – groups of documents that can be manipulated together
    • Moved as a unit
    • Workflow applied to the document set
    • Permissions applied to the document set
    • Meta-data applied to the document set
    • Version controlled as a group (in addition to individually)clip_image008
  • Document Ids – assign a unique ID to every document or document set
    • Find your document regardless of where it’s located

How will this help?

1. Groups of documents can be managed as a unit e.g. project documents, policy documents

2. Documents can be tracked based on ID regardless of location

Workflow

What are the new features?

  • Create reusable templates
  • Create custom reusable workflow components
  • Initiate workflows on events other then

How will this help?

1. Define internal processes as workflows to ensure policies and standards are met

2. Reuse templates in multiple places e.g. approval workflow used across multiple document libraries in many sites

3. Allow business users to create workflows based on components pre-developed

Records Management

What are the new features?

  • Documents can be converted to records in place; they don’t have to be moved to a records repository
  • Routing engine
    • Allows you to define rules to place documents in a specified locations based on meta-data
    • Drop off a document in a drop off library and they will be placed automatically

How will this help?

1. Records management and retention policies can be configured in the SharePoint site to ensure documents are kept and audited for the necessary time period

2. Routing engine allows placement of documents to be managed based on rules.

Social Networking

What is it?

  • New features through the MySites component encourage users to share information about themselves, and see updates provided by other users
  • Informal tagging (separate from the Term Store) can be used to allow users to freely tag content with any term they want

clip_image010

What are the features?

  • Ability to update your status i.e. micro-blogging
  • Connections are established to people across the business based on similar areas of expertise, interests etc.
  • Newsfeed allows you to see what your colleagues and connections are up to
  • Any content on the site can be tagged for private or shared reference
  • Tag clouds show users graphically the tags they use
  • Content can be rated from 1 to 5 and an aggregated rating can be seen of all users rating

clip_image012

How will this help?

1. Encourage users to build a presence on the intranet

2. Increased capture of user data such as “ask me about”, “interests” and “areas of expertise” allows people to find experts in the business

3. Freedom for users to tag content with terms that they use themselves e.g. “Favourite” or “Read this”

Business Connectivity Services (BCS)

What is it?

  • The BCS allows connections to be established to Line of Business (LOB) applications to read/write

What are the features?

  • You can read/write/update/delete from LOB applications (BDC in MOSS was read only)
  • Big efficiency improvements over MOSS

How will this help?

1. Integrate LOB applications with SharePoint allowing users to work with other systems through the familiar SharePoint interface

2. Modify LOB data using workflow

SharePoint Workspace

What is it?

  • The latest version of Groove – a tool to take content offline and syncing back to the server

What are the features?

  • Seamlessly sync SharePoint content such as sites, lists, documents to your local machine
  • Work offline and sync back to server

How will this help?

  • Users can continue to work on content when connectivity is an issue

Access and Visio Services

What is it?

  • Access applications can be published to SharePoint creating lists, workflows, forms and reports
  • Visio can now be rendered in the browser for reading and collaboration much like the existing Excel Services

What are the features?

  • Access services
    • Access applications are hosted within SharePoint and the Access DB file can be regenerated based on the hosted application
    • Access macros work but VBA code doesn’t
  • Visio services
    • No client side version of Visio is needed
    • Functionality is limited in Visio services compared to the fully blown product
    • Workflow can be visualized using Visio services

How will this help?

  • Greater reach of Access applications
  • Access can be used by business users as a design tool for simple applications
  • Collaboration on Visio documents where not all users have Visio locally installed

Large list Performance

What is it?

  • Improvements in how data is stored and accessed from SharePoint

What are the features?

  • Query throttling to prevent queries consuming too many resources from affecting server performance
  • Remote BLOB storage
    • Store large files in an external system
  • Batch queries
  • External lists
    • Pull entire list data from an external store

How will this help?

  • Far better performance accessing large lists
  • Data can be held in other database applications and accessed from within SharePoint and used in the same way as a list

Wednesday, May 19, 2010

SP2010 Document Set Versioning Issue

Document set versioning doesn’t persist copies of the documents contained within that set, so if you delete a document, you can’t restore it through the document set version history.

Here are the steps I took to demonstrate this:

1. Create a document library and allow the Document Set content type to be used

2. Turn versioning on (major versioning)

3. Upload some documents to the document set

4. Capture a version of the document set:
clip_image001[4]

5. View the version history at this point:
clip_image002

a. You can see 3 documents as part of this document set

6. Delete a document (in this example I deleted Research.docx)

7. Capture a version of the document set

8. View the version history:
clip_image003

a. The Research.docx document can’t be found!  You don’t even see the name of the document that was removed...

9. If I try to restore this previous version I get the following error:
clip_image004

Monday, May 17, 2010

SharePoint 2010 Content Organizer

The following is a very quick overview of the SP2010 Content Organizer feature.  Not just for records management!

  • This is a web scoped feature you can enabled on any site
    • It creates a Drop Off Document Library and adds new settings on the Site Settings interface

clip_image001[6]

  • You can then define rules for moving content about based the content type and meta-data associated with the content
    • This could involve dropping a document into a specified library or moving it to another site entirely

clip_image001[8]

  • Users can then upload a document to the Drop Off Library (you can change this name) and the document will be automatically routed to the correct location if a rule matches
    • This is awesome for helping maintain an IA
    • Makes life easy for the users as they don’t have to worry about which folder to drop a document into
    • You could even prevent users uploading documents to ANY other doc lib in your site so your rules handle the placement of everything
  • If no rules are matched then the document remains in the Drop Off Library and an admin can manually move it