Tuesday, July 15, 2008

Automate Web App Deployment with the SharePoint API

cool article I came across. notice the code download is available inside the article.

http://msdn.microsoft.com/en-us/magazine/cc507633.aspx

Branding SharePoint WSS 3.0/MOSS 2007

WSS v3.0 and MOSS 2007 have changed the landscape dramatically; now built entirely on the ASP.NET 2.0 framework master page/page layout infrastructure.

Content Types with a List or Document Library

SharePoint Designer Workflow vs. Visual Studio Workflows

SharePoint Designer Workflows

  • Can not redeploy. Workflows designed using SharePoint Designer apply to a single site, and cannot be redeployed easily. (It is actually possible, but is a developer task.) Major limitation vs Visual Studio approach
  • Numerous limitations to the structure and flow of your workflow. Examples include not being able to update multiple items, or see if the value of a field has changed - see here for more details. Major limitation vs. Visual Studio approach
  • Simplistic ‘Outlook Rules’ approach to designing workflow logic. It works, but isn’t as flexible as Visual Studio.
  • No dynamic task assignment. No task assignment based on availability, current workload, round robin, etc.
  • No interaction with external systems. This has to be done as a development task.

Visual Studio Workflows

  • Developer Task. You need a developer to do this.
  • Awkward. The tools for developing workflows are still in their infancy. Debugging is particularly bad (read ‘effing painful’). Development of workflows is slow.
  • Aspects are still pretty much undocumented.
  • InfoPath and Workflow don’t really use the same data structures. Thus, data handling between them is awkward. Avoid Repeating Fields at all costs (e.g. lines on an invoice)

Both

  • Workflows are Document Centric. (Or more correctly, ListItem-centric). An item (usually a document) ‘owns’ a workflow. A Workflow does not ‘own’ or ‘hold’ document(s). There is no equivalent of a ‘Workflow Attachments’ folder as in some other products. It is possible to bind multiple documents together using a common piece of meta-data (e.g. ‘Case Reference’), but the viewing of the process’ documents is troublesome - and probably via search. And it is possible to have processes for multiple documents - by have a separate workflow for each document. Thus, if you business process contains, say, 5 documents, then you’d need 5 workflows. This will also cause havoc when you start planning reporting on the workflows. Try to avoid processes which contain multiple documents.
  • Documents can only have one of each workflow running against them.
  • Rubbish tracking and reporting. Events just get recorded into a ‘Workflow History’ list. This does not support reporting on very easily - certainly not like a database table.
  • Delay Steps do not work OOB. That’s right, you can’t build delay steps into your workflow without first installing a patch from MS Professional Services - one which we haven’t laid our mitts on yet. That’s right, bang go all of your escalation processes. Nobody would want to do that in a workflow, right?
  • No view over all Tasks in environment. Users can be shown a list of all tasks in a single Site Collection, but not all Site Collections.
  • Workflow host can’t be split of onto it’s own server. Or at least, I’ve never found a way. In systems with LOTS of workflows, this will impact performance.

Update Multiple list items using SharePoint Designer Workflow

Simply can not be done.

  • Numerous limitations to the structure and flow of your workflow. Examples include not being able to update multiple items, or see if the value of a field has changed - see here for more details. Major limitation vs. Visual Studio approach
  • You cannot loop. If you want to perform an action on say all items in a list or all child items for a parent, you simply cannot do it unless you know how to lookup each item in the list at design time and have an action for each of those items.

Increase Max File Upload Size

Increase the maximum upload size-

Open Central Admin >

To increase the size, click on "Application Management", "Web ApplicationGeneral Settings" and make the change.

Default max size is set to 50 mb

Monday, July 7, 2008

Batch file for creating new sites with content databases

:: This batch file calls SharePoints admin executable to create a new SharePoint site in:: its own database at the Site level. Arguments are as follows::::: %1 - Site Name (No spaces or quotation marks):: %2 - SiteTemplate Site Template--do not include extension of .STP)::

echo off

if NOT "%2" == "" goto SiteTemplate

echo Creating Site (http://url.com/sites/%1) and database (WSS_%1) with no template

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o createsiteinnewdb -url http://url.com/sites/%1 -ownerlogin "domain\administrator" -owneremail owner@domain.com -databaseuser "sa" -databasepassword "password" -databaseserver "dbname" -databasename WSS_%1 -title %1

goto eof

:SiteTemplate

echo Creating Site (http://url.com/sites/%1) and database (WSS_%1) with template (_GLOBAL_#1)

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o createsiteinnewdb -url http://url.com/sites/%1 -ownerlogin "domain\administrator" -owneremail "owner@domain.com" -databaseuser "sa" -databasepassword "password" -databaseserver "dbname" -databasename WSS_%1 -sitetemplate _GLOBAL_#1 -title %1

:eof

How to add a solution and deploy it

----------adding the solution
1) Locate the WSP file that you want to install in Windows Explorer.
2) Open the command prompt.
3) Go to the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
directory. This directory may be different depending on your server setup.
4) Type stsadm –o addsolution –filename
5) Drag the WSP file from the Windows Explorer over onto the command prompt. This will
automatically type in the location and filename of the WSP.
6) Press Enter.

-----------deploying the solution
1) Locate the WSP file that you want to install in Windows Explorer.
2) Open the command prompt.
3) Go to the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
directory. This directory may be different depending on your server setup.
4) Type stsadm –o addsolution –filename
5) Drag the WSP file from the Windows Explorer over onto the command prompt. This will
automatically type in the location and filename of the WSP.
6) Press Enter.

Monday, June 16, 2008

InfoPath 2007 & SharePoint WSS 3.0

So you have been thinking about making some InfoPath forms for your SharePoint users...think again.

Just because I have InfoPath installed on my machine doesn't mean all 4,000 of our users do and we don't have Forms Server. So keep in mind the following rules:

  • If Microsoft Office SharePoint Server 2007 with InfoPath Forms Services is installed on your network, you can publish a form to a SharePoint library. From there, users can complete the form by using their Web Browser if InfoPath is installed on their computers.

  • When you publish InfoPath forms to a server on which Office Sharepoint Server with InfoPath Forms Services is installed, users do not need to have the InfoPath software installed on their computer to fill out the forms. they can simply use their web browser.

Friday, June 13, 2008

CorasWorks DIT Training

I finally got registered for training and made the travel arrangements yesterday. I'll be going the end of this month --

Thursday, June 12, 2008

Resolved the Distored Site Issue

Enabling site features - note to self, any custom site features that are enabled on your sites you need to deactivate before doing a backup and restore on a new server. Trying to restore the sites with site features that are not installed on your new server will result in an ugly/distorted site.

It took us almost two full days to come to this conclusion and test our theory, which worked - thanks to my boss. =)

Friday, June 6, 2008

Distorted WSS 3.0 Restored Site from Backup

Ok....seriously....on a Friday afternoon. I finally start restoring sites and this is what I get....brace yourself for a huge laugh. The first obvious issue here is 1. CSS file - what did the file not come over during the restore? This site didn't use an altered master page so what gives?

My Googling for today is about up....HELP!

Any new sites I create are working and displaying properly, this problem is only with restoring a site from a .bak file via stsadm prompt.



Thursday, June 5, 2008

Export List of Current SP Sites

This is very handy...

1. On the current server, open command prompt. Type:

· Stsadm –o enumsites –url >c:\sites.xml
· (ex: stsadm –o enumsites –url http://url.com >c:\sites.xml)

This will export a list of all current sites housed under the url into the xml file called sites.xml. Use this as a guide to ensure all sites are backed up and moved over.

2. Repeat for all urls and change your file name if you have multiple URL's

SMTP Service Not Installed - Setting up Incoming Email

I'm in the middle of my very first server configuration and while setting up Incoming Email I got an error stating I did not have the SMTP service installed. I seem to be coming across a lot of these little errors which are making me aware of all the details I did not cover before starting. This particular error was not major and took 10 minutes to resolve, however I just wonder what else is out there that I might be missing as well. I guess my words of advice here are to read all installation requirements for both the back end server and front end server before installing. In case you are wondering, here is the fix for the SMTP error.

SMTP Server Setup (IIS 6.0)
The Simple Mail Transfer Protocol (SMTP) service provided by IIS is a simple component for delivering outgoing e-mail messages. Delivery of a message is initiated by transferring the message to a designated SMTP server. Based on the domain name of the recipient e-mail address, the SMTP server initiates communications with a Domain Name System (DNS) server, which looks up and then returns the host name of the destination SMTP server for that domain.
Next, the originating SMTP server communicates with the destination SMTP server directly through Transmission Control Protocol/Internet Protocol (TCP/IP) on port 25. If the user name of the recipient e-mail address matches one of the authorized user accounts on the destination server, the original e-mail message is transferred to that server, waiting for the recipient to pick up the message through a client program.

In the case where the originating SMTP server cannot communicate directly with the destination server, the SMTP service can transfer messages through one or more intermediate relay SMTP servers. A relay server receives the original message and then delivers it to the destination server, or redirects it to another relay server. This process is repeated until the message is delivered or a designated timeout period passes.

The SMTP service is not installed by default. You must install the SMTP service using the Control Panel. Installing the SMTP service creates a default SMTP configuration which you can then customize to your needs using IIS Manager.

Many articles about deploying and configuring the SMTP service are available by searching for "smtp" on the Microsoft Developer Network (MSDN) Web site.

Procedures To install the SMTP service
1.From the Start menu, click Control Panel.
2.Double-click Add or Remove Programs.
3.From the left pane, click Add/Remove Windows Components.
4.From the Components list, click Application Server, and then click Details.
5.From the Subcomponents of Application Server list, click Internet Information Services (IIS), and then click Details.
6.From the Subcomponents of Internet Information Services (IIS) list, select the SMTP Service check box.
7.Click OK.
8.Click Next. You might be prompted for the Windows Server 2003 family CD or the network install path.
9.Click Finish.

When you install the SMTP service, a default SMTP server configuration is created with a message store in LocalDrive:\Inetpub\Mailroot.
When setting up the SMTP service for the first time, you can configure global settings for a SMTP virtual server, as well as settings for individual components of the virtual server.

Important
You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".

Backup and Restore

We are in the middle of a server migration so I thought I would share some commands for backup and restoring sites.

Commands for backup:

1. For top level sites and subsites.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o export -url
http://.... –filename ...... -includeusersecurity.

2. Only for top level website.
c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o backup -url
http://.... –filename ......

3. Catastrophic backup of a web application.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o backup -directory \\.... –backupmethod full –item ”web application name(sharepoint - 80)”

4. Catastrophic backup of the entire farm.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o backup -directory \\.... –backupmethod full

5. Attach a content database:

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o addcontent db -url
http://.... –databaseserver……. -databasename ........

Commands for restore:

1. For top level sites and subsites.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o import -url
http://.... –filename ...... -ncludeusersecurity.

2. Only for top level website.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o restore -url
http://.... –filename ......

3. Catastrophic restore of a web application.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o restore -directory \\.... –restoremethod new –backupid ………….

4. Catastrophic restore of the entire farm.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o restore -directory \\.... –restoremethod new

Tuesday, June 3, 2008

Blog set up...

I never imagined I would end up sitting here trying to format my page....so beware as it will go through several rounds of changes until I get it just right.

The concept of blogging never really interested me, since I find myself spending half my day on Google search I figured it was time. Not only will I be able to reference my previous issues, everything will be in one place opposed to documents and articles sitting on my desktop in a very unorganized fashion. Perhaps someone other than my myself and my team will find it useful.

Wish me luck and check back often.

WSS 3.0/MOSS Install Error

Today when I was trying to configure a new server I ran across the following error upon installing WSS 3.0

This is the second time we have seen this error and were somewhat familiar with it, thanks to the below post we were able to fix it pretty quickly and move on with the installation.

Error Message:

Setup is unable to proceed due to the following error(s):

This product requires ASP.NET v2.0 to be set to ‘Allow’ in the list of Internet Information Services (IIS) Web Server Extensions. If it is not available in the list, reinstall ASP.Net v2.0. Correct the issue(s) listed above and re-run setup.

Fix:

Well, with the help of this
blog post, I was able to get it working. Here’s the deal: I believe the issue was that IIS (with ASP.NET support in Windows Components) was installed/enabled after the installation of .NET 2 and .NET 3 and their service packs. As a result those frameworks were not registered in IIS.

Enter the
aspnet_regiis command. It is found in the following folder(s):
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727 – 64-bit Windows only.
I ran the command with an –i switch in the second directory, as this was an x64 box. The MOSS Enterprise setup worked just fine after that. There are dangers to running the –I switch on production boxes
here, but since this was a fresh server with nothing on it, the aspnet_regiis –i worked perfectly for me. I did also need to allow .NET extensions in IIS.