SharePointsBlog

Interesting Exploits in Office 365 and SharePoint

Category Archives: Administration

Content Types and Workflows

The process of creating content type based workflows is sometimes daunting for the SharePoint professional because it requires a number of steps and the order of those steps is critical.

In this tutorial, we have a Content Type Hub defined for our farm and a team site in which we want to use a content type hierarchy to manage our content. For a specific hierarchy of content types, we want to have a specific workflow available to process the content. We don’t want to have this workflow apply to other content types in the library, only specific types of content.

This example steps through the manual process of workflow creation using SharePoint Designer and standard SharePoint administrative features. Obviously, the process can be automated or packaged into features to expedite the publication of the workflow to multiple sites.

Let’s start with our assumptions:

  • the Content Type hierarchy has been defined in our Hub
  • the target team site has been created

The Content Type hierarchy that we have created is as follows:

  • Document
  • Enterprise Document
  • Administration
  • Equipment Operation Manuals and Specifications

For this exercise, we will be associating our workflow with the Administration content type and subsequently applying the workflow to the child content type, Equipment Operation Manuals and Specifications.

Step 1: Create workflow at the Content Type Hub

This will be a reusable workflow that is associated to our parent content type (because we want to work with specific columns of that content type).

Assign Workflow to highest level content type

When creating the workflow, ensure that you have selected the content type to associate to the workflow. If you don’t select a content type, the specific columns will not be available to the workflow.

Step 2: Define the content of the workflow

In our sample workflow, we are only going to manipulate specific column values. I would anticipate that your workflow will be much more complex than this.

Save and Publish the workflow

The workflow must be saved and published. This will make the workflow available in our Content Type Hub.

Step 3: Export the Workflow to install into our target team site

Because the Content Type Hub only publishes the workflow association and not the workflow itself, we must package and install the workflow into our team site. This involves saving the workflow as a portable template (in the form of a WSP).

The Workflow is saved in the Site Assets library in the content type hub (where we created the content type)

Navigate to the Site Assets library and download a copy of the workflow

Save the WSP to a local location on the drive

Step 4: Install the workflow in the target site

Navigate to the site where the workflow is to be used.

Go to Site Settings > Solutions

Upload the solution to the site

Once uploaded, select Activate

Navigate to site settings (in the target site)

Go to the Site Actions area and select Manage Site Features

The Activated workflow solution will now appear as a site feature. Activate this feature

Step 5: Associate the Workflow to the Content Type Parent

Go back to the Content Type Hub and navigate to the content type that you want to associate to the workflow

Select Workflow Settings

We are going to add the new workflow to the Parent Content Type, Administration

Configure the options that you want for the workflow.

IMPORTANT: Make sure that you select “Yes” for the “Add this workflow to all content types that inherit from this content type?”

In the Workflow Admin Screen, select “Update all content types that inherit from this type with these workflow settings

Step 6: Publish the updated content type

Now we need to publish the content type and the changes back out to our subscribing sites

Navigate back to the content type (parent)

Select the manage publishing

If the content type has been previously published, you will need to republish it

Step 7: Publish the Content Type

Once the Publish/Republish has been selected go to Central Admin and run the Content Type Hub and Content type Subscriber jobs

Step 8: Validate the Target Site Configuration

Once the publishing jobs have completed, navigate to your target site and assign the content types to a library.

Once you import content and assign to one of your content types, you will then be able to use the workflows

Select an item and workflows

You will see the workflow assigned to the content in the target library

Hopefully you have found this post useful and can easily see where you can apply this process to your environment and applications.

Advertisements

Content Database Files –Where are you?

I have been asked several times this week where the SharePoint 2010 content database files and log files are stored by default.  Well, sort of hard to answer as everyone seems to install their SQLServer slightly differently and the locations of these files depends on how you approach the installation of SQLServer.

If you “click through” the installation, not really paying any attention and take the defaults, then your database files and log files are going to be created and stored in the default location.  This typically is C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA.Choice_jpg

If we create our databases in SQL Server Management Studio, we can specify the location of the MDF files and LOG files.  However, we will have to go through some manipulation to use a pre-created content database in Central Administration – probably not the most streamlined approach.  However, the pre-creation of content databases may be the optimal solution if your organization has DBAs that don’t want the SharePoint Administrators creating databases all over the place.

So, here is a quick tip and modification that you can give to your DBA so that the data and log files go in the location that they want and you don’t have to go through down-time or other configuration steps to have the default Central Administration Create Site Collection process do what you expect it to do.

The simple SQL script below can be executed to change the default location for MDF and LOG files:

USE [master]
GO
EXEC xp_instance_regwrite N’HKEY_LOCAL_MACHINE’, N’Software\Microsoft\MSSQLServer\MSSQLServer’, N’DefaultData’, REG_SZ, N’D:\SQL_Data’
GO
EXEC xp_instance_regwrite N’HKEY

USE [master]
GO
–Data file
EXEC xp_instance_regwrite N’HKEY_LOCAL_MACHINE’, N’Software\Microsoft\MSSQLServer\MSSQLServer’, N’DefaultData’, REG_SZ, N’Location’
GO
— Log file
EXEC xp_instance_regwrite N’HKEY_LOCAL_MACHINE’, N’Software\Microsoft\MSSQLServer\MSSQLServer’, N’DefaultLog’, REG_SZ, N’Location’
GO

Don’t forget that Sharepoint’s Central Administration interface nor powershell provide the ability to specify a location for the MDF and/or log files.

Leverage Removable Drives in Windows Libraries

globeWindows 7’s libraries are a really convenient tool for quickly accessing your data (or putting data from multiple locations into one window), but it doesn’t let you add removable flash drives or SD cards. Through some fancy searching and testing (playing around), I figured out how to leverage removable storage within a library.

Go to Libraries and right click on Libraries, select New/Library and give it a name—Removable Drives for example.

Right click it and hit Properties. There’s the magic button “Include a Folder”.

Unfortunately it doesn’t work. It tells you you can’t add removable media. Removable media can be used, and according to Microsoft,

“Only if the device appears in the navigation pane, under Computer, in the Hard Disk Drives section. This is set by the device manufacturer, and in some cases, it can be changed. Contact your manufacturer for more information.”

The way to do this is to go to a known location on your hard drive—C:\ perhaps—and create a folder called Pictures Card, or whatever.
 
Start the Computer Management program (Right click on Computer -> select Manage) and click on “Disk Management” in the left-hand sidebar.

Right click your removable drive and select “Change Drive Letter and Paths”.  You will first need to remove the drive letter assigned.

Click Add and select “Mount in the following empty NTFS folder”. Choose the folder you made earlier (e.g., C:\Picture Card). Now if you look in the C:\Picture Card folder you’ll see the contents of your SD card.
 Library Image
Now, if you right click your new Library you made earlier and add C:\Picture Card to it, it’ll work!

For each removable resource you want to index or search create a new folder and go to Computer Management to enable it to be added to a Library.

Note, of course, that the resource needs to be available to Windows for you to see the files. If you put the picture card back in the camera, Windows won’t be able to display the contents. The previously indexed contents however remain good next time you insert the drive.

SharePoint_Config Database Suspect Mode – Cannot Connect to the Configuration Database Error

If SQL Server ever crashes or hard booted, you may come across a possible corrupted SharePoint_Config database. Recently while doing SharePoint 2010 configuration of our new product suite on my VM, I had to hard reboot the VM. When the VM came back up, I received the dreaded “cannot connect to the configuration database error”.  This occurs while accessing any of the content web application.

cannot-connect-to-config-db-error

I’ve seen this condition before, so I tried the usual debugging avenue – – IIS Web Site availability, IIS Application Pool Availability. IIS Application Pool Identity, and SQL Server availability. (see http://support.microsoft.com/kb/823287)  After walking through these steps, I noticed that “SharePoint_Config” database was in suspect mode. (notice the order of the items in my debugging avenue…yes, SQLServer was last)

sharepoint_config_suspect1

A quick BING took me following links to fix this issue.

http://ahmershahid.wordpress.com/2009/05/25/moss-2007-config-db-in-suspect-mode/
http://www.aarat.com/sharepoint-config-database-suspect/

As it turned out, it’s not a SharePoint issue. Any SQL Server databases can be corrupted and gets in the suspect mode. The following steps will fix the suspect database mode issues. As usual, I don’t take credit for this solution, but only post as a reference.  The credit goes to above blogs.

— Use the Master database
Use Master
— Verify that database has issues
EXEC sp_resetstatus ‘SharePoint_Config’
— Put the database in emergency mode
ALTER DATABASE SharePoint_Config SET EMERGENCY
DBCC checkdb(‘SharePoint_Config’)
— Set the database in single user mode
ALTER DATABASE SharePoint_Config SET SINGLE_USER WITH ROLLBACK IMMEDIATE
–Repair the database with data loss
DBCC CheckDB (‘SharePoint_Config’, REPAIR_ALLOW_DATA_LOSS)
–Set the database in multi-user mode
ALTER DATABASE SharePoint_Config SET MULTI_USER
–Verify that database is reset
EXEC sp_resetstatus ‘SharePoint_Config’

To fix SQL Server database suspect mode, we need to use the SQL Server’s emergency mode which allows you repair the database by reparing to last normal state.

After running the script on the Master database, SharePoint_Config database suspect mode was fixed and I was able to access the content web application.

sharepoint_config_suspect_r

SharePoint 2010 Resources – Getting Started

I often get questions about finding information on SharePoint 2010, the best places to learn and the “hows” and “whys”.  It seems that many people will type in a single word or phrase into their favorite search engine…look at the first page and throw up their hands saying they can’t find anything.

It is the unfortunate state of our world with information overload and the attention spans of fleas.  I also find that many people seem to assume that every post/site or page on the web is absolutely factual and they don’t know how to determine the validity of the information they are ready.

With this commentary on society out of the way, I figured i would post some “getting started” links and resources for those of you wondering how to get started.

General SharePoint Information 

Main Microsoft Site (running on SharePoint 2010) – http://sharepoint.microsoft.com/en-us/pages/default.aspx

Capability Overview – http://sharepoint.microsoft.com/en-us/product/capabilities/Pages/default.aspx

Edition Comparison – http://sharepoint.microsoft.com/en-us/buy/Pages/Editions-Comparison.aspx

Training

Advanced IT Pro Training – http://technet.microsoft.com/en-gb/sharepoint/ff677987.aspx
IT Professional Overview – A video that shows you some of the great new features in SharePoint 2010
Experiencing the Microsoft SharePoint 2010 User Interface – A video that provides a look at the new, improved user interface in SharePoint 2010

Getting Started Screencast Series – A series of entry-level screencasts by Microsoft SharePoint MVPs that lets you take advantage of an 11-module e-learning course

Training and Certification – http://www.microsoft.com/learning/en/us/training/sharepoint.aspx

Documentation

Full TechNet Documentation – http://technet.microsoft.com/en-us/library/ee428287.aspx

The Total Economic Impact of SharePoint 2010 – http://go.microsoft.com/?linkid=9730143

Downloads

Download trial – http://technet.microsoft.com/en-us/evalcenter/ee388573.aspx

VM demonstration images – http://go.microsoft.com/?linkid=9728417

 

Communications

SharePoint Team Blog – http://sharepoint.microsoft.com/blog/Pages/default.aspx

SharePoint 2010 Forums
  

Downloadable Books

Getting started with SharePoint Server 2010 – http://go.microsoft.com/fwlink/?LinkId=191146

Planning guide for SharePoint Server 2010 – http://go.microsoft.com/fwlink/?LinkId=196150

Upgrading to SharePoint Server 2010 – http://go.microsoft.com/fwlink/?LinkId=196221

Deployment guide for SharePoint Server 2010 – http://go.microsoft.com/fwlink/?LinkId=196222

Operations guide for SharePoint Server 2010 – http://go.microsoft.com/fwlink/?LinkId=196154

Technical reference for SharePoint Server 2010 – http://go.microsoft.com/fwlink/?LinkId=196155

 

Diagrams and white papers

Technical diagrams (SharePoint Server 2010) – http://blogs.technet.com/b/seanearp/archive/2010/07/09/technical-diagrams-for-sharepoint-2010.aspx

Evaluation guide for SharePoint Server 2010 (white paper)

Developer Resources

SharePoint Development Center – http://msdn.microsoft.com/en-us/sharepoint/default.aspx

Setting Up the Development Environment for SharePoint 2010 on Windows Vista, Windows 7, and Windows Server 2008

What’s New in SharePoint Foundation 2010

What’s New in SharePoint Server 2010

Get Started Developing on SharePoint 2010

Getting Started with Development for SharePoint Foundation

Training

Starting Point – http://msdn.microsoft.com/en-us/library/ff770300.aspx

Excellent Free Developer Training – http://msdn.microsoft.com/en-us/sharepoint/ff420377.aspx

Channel 9 Training – http://channel9.msdn.com/learn/courses/SharePoint2010Developer/

SharePoint Developer Training Kit Download – http://www.microsoft.com/downloads/en/details.aspx?FamilyID=83a80a0f-0906-4d7d-98e1-3dd6f58ff059&displaylang=en 

Documentation

SharePoint 2010 SDK Documentation

SharePoint 2010 Technical Articles – Technical articles are 15-20 pages in length and provide detailed technical information and code examples

SharePoint 2010 Book Excerpts –  Book excerpts are online excerpts of published books.

SharePoint 2010 Visual  How-Tos  – Visual how-to articles are 10-15 pages in length and combine some of the best elements of blogs, video, and technical articles by providing a brief overview, a code sample, and a how-to video.

SharePoint 2010 Quick Notes – Quick Notes are 2-4 page tasks in a single scenario.

Search connector development – http://msdn.microsoft.com/en-us/library/ee556429.aspx

Code Samples

SharePoint Downloads and Samples
SharePoint Code Gallery Projects
SharePoint CodePlex Projects

Microsoft Certification – SharePoint 2010 Administration

I have been working over the past three weeks on my SharePoint 2010 Administration skills and knowledge. All of this effort was in preparation for taking the MCIT 70-668 exam this week.

Well, I took my exam yesterday, and was very surprised at the experience. I showed up at the testing center about 30 minutes before my appointment. Of course, the doors were locked as no one had shown up yet.

A few minutes later, the doors were opened and I sat down. After showing my ID, and having the test admin boot and login to the PC, I was finally on my way. To my amazement, the test isn’t anything like I expected.

I read through the questions, carefully evaluating the choices for the answers. I purposefully didn’t wear my watch so I could focus on the test instead of the time. Not once did I look at the clock, or worry about the time.

Moving though the test, I started to appreciate the amount of review that I did. But I did realize that I was breezing through the questions faster than I thought reasonable, so I slowed my pace, reviewing each question carefully.

Moving through the test, and reaching the end…I planned no review of my answers. I’ve been burned by second-guessing my answers in the past. Finally finishing all of the questions, I went through the survey and completed my test.

I walked out of the testing room and was handed my results…perfect score!

I have been working with SharePoint 2010 for almost 18 months, and that experience, along with some prep-work enabled my successful completion of my first certification.  I would also recommend CertificationTutorials as a source for practice and study guides. Yes, it costs money, but this resource was invaluable in my preparation.

I strongly advise those of you out there contemplating getting your certifications to do it. While it may be daunting, difficult to schedule, and overall a pain, it sure makes you feel good when it is over.

Now on to the SharePoint Configuration exam, 70-667, to complete my MCITP for SharePoint 2010.