6.22.2011

Automating SharePoint Server Warm-up

This week I’m in a SharePoint training class. Specifically, SharePoint 2010 business intelligence.

Common actions at most SharePoint trainings include “iisreset” and server reboots. No big deal, except that after either of those events SharePoint pages load very slowly the first time around. That really slows me down on labs and annoys me.

This is why I like to set up a warm-up script to run automatically after either event. Here’s how…

Copy the warm-up script from: http://blog.idevteam.nl/2010/10/sharepoint-2010-warmup-script.html Other variations can be found at many different sites, this is just the one I’m using.

Paste it into a notepad document, and save it with a “ps1” extension. Then open up task scheduler and create a task with the following settings:

Triggers:

  • At System Startup
  • On an Event
    Log: System, Source: IIS-IISReset, Event ID: 3201

Actions:

  • Program/Script: C:\windows\system32\windowspowershell\v1.0\powershell.exe
  • Arguments: “& ‘path-of-warm-up-script-here’”

Save the task and you should have a little bit faster load times after IIS restarts.

2.23.2011

Live@EDU SharePoint Single Sign On WebPart

At our school, we have been using Outlook Live@EDU for a while now with the Chisolm Web Part for SharePoint Single Sign On found at codeplex. This has been working well for us, but we’re concerned about the alerts we’ve been getting from Microsoft about the upcoming URL change for SSO to outlook.com/edu.

When the web part was built the address was mail.live.com, and apparently that address is going to stop working. Another issue that we have come across with the URL is that we do not require the students to enter their birthday and agree to the EULA the first time they log in because we already have them sign the documents when they enroll at the school. But they were getting the prompt when setting up their account via the web part. Since we are using outlook live and not Hotmail, it only bypasses those prompts when we direct the students to outlook.com/edu.

So, I updated the Chisolm Web part to use the new URL. Now it does not prompt us for Birthdates and EULA agreements, and it should continue working even after mail.live.edu stops.

Another modification I wanted to make, was to have the webpart grab the SLT upon button click instead of page refresh to eliminate timeout errors, but alas, I have no coding knowledge (outside of HTML… 1… and Basic… as in TI-83+ Basic…) so that didn’t happen. I’ll probably still monkey with it from time to time, but if anyone has already made that tweak, let me know please! It’d be greatly appreciated.

Here is the link to the MSI file for the web part with the updated URL use the same installation instructions as the original webpart: http://cid-667155e16da8803f.office.live.com/self.aspx/Public/Chisholm.Windows.Live.Installer.msi

NOTE: We use Direct Connection. So, I have not tested the middle-tier server solution. I do not know if that works. I assume it does. If you find otherwise, let me know in the comments. Thanks!

1.10.2011

sharepoint_config database in suspect mode

My SQL 2008 server’s data drives are on our SAN. Our SAN went down for a few minutes the other day. After our SAN came back up, my SharePoint configuration database was in “suspect” mode and I could not access SharePoint at all. “Cannot connect to the configuration database.”

I don’t know much about SQL, just enough to get SharePoint installed. So, I didn’t know how to fix this until I found this great post! http://blog.van-huizen.com/2009/10/how-to-repair-sql-server-2008-suspect.html

Unfortunately, it didn’t work for me. I tried the first command in a new query and it threw an error about not being able to connect to the database.

Eventually, I got all the commands to run, so I thought I’d add my notes to the post. Here’s what I did:

Open a command prompt. (Start | Run | cmd)

If you are using a default instance of SQL server open SQL command prompt by entering:

sqlcmd

If your SQL server is using a named instance other than the default enter this command instead (replacing servername and instancename with your server and instance names):

sqlcmd –Sservername/instancename

You should now have a 1> prompt. Enter the first command followed by a “GO” command. Replace YourDBname with the name of the Suspect database.

1>DBCC CHECKDB (’YourDBname’) WITH NO_INFOMSGS, ALL_ERRORMSGS

2>GO

I had never used SQL command prompt before. didn’t know I needed to enter a “go” command after each command. Continue the same process for the rest of the commands.

1>EXEC sp_resetstatus ‘yourDBname’;

2>GO

1>ALTER DATABASE yourDBname SET EMERGENCY

2>GO

1>DBCC checkdb(’yourDBname’)

2>GO

1>ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE

2>GO

1>DBCC CheckDB (’yourDBname’, REPAIR_ALLOW_DATA_LOSS)

2>GO

1>ALTER DATABASE yourDBname SET MULTI_USER

After this, my database was back online and I could log into SharePoint.

REferences