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

5.28.2010

Upgraded to Service Pack 2. Flyout menus don’t work.

Upgraded to MOSS Service pack 2 the other day. Seemed like a no brainer to me as we contemplate preparing for SharePoint 2010.

Upgrade went okay… Afterwards the flyout menus on all pages with our custom branding did not work!

Took a lot of searching to finally find an answer…

turns out the Core.js file has a line that says:
var flyoutsAllowed=false;

Change the false to true, and flyouts were working again!

yay!

Thanks to these guys:

http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/30deddd9-8c81-4dbc-90d5-c30172ff36f9

4.08.2010

Renaming SharePoint Servers

I made a virtual dev environment for SharePoint because visual studio demanded we have it installed on a SharePoint server if we wanted to make web parts with it and VSeWSS. That part went okay. Next step was either build 2 more from scratch for the rest of the team, or copy and rename the one I already built. I chose to copy and rename (don’t want duplicate machine names on the network).

The server was a MS virtual PC machine running Server 03 R2 x86, MOSS 2007, and SQL express 2005 (or whatever a standalone install of SharePoint installs).

Renaming the server is the easy part. So I changed my server name from spdev-old to spdev-new like it was NBD (don’t restart yet). Wasn’t sure how to make SharePoint know I made the change though…

As it turns out… that’s easy too! Yay!
win+r | cmd | Enter

then type:
stsadm –o renameserver –oldservername spdev-old –newservername spdev-new

If that command doesn’t work… then you didn’t add the 12 hive BIN to your system’s path, and you’ll need to change directories to the 12 hive before running the stsadm command. The command to navigate to the directory is:
cd %programfiles%/common files/microsoft shared/web server extensions/12/Bin

However, I recommend adding it to your path because stsadm is a handy tool that you will use a lot. 
To do this:
right click My Computer > Properties > Advanced Tab > Environment Variables > find “path” under system variables > edit
At the very end of the variable value add:
;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

You can restart after the stsadm command completes successfully.
shutdown –r –t 00

Now we’re almost done… just need to change the alternate access mappings in SharePoint Central Admin.

Open Central Admin. It fails. Change the name in the address bar to the new name. It works, Congratulations!

Go to: Operations | Alternate Access Mappings

Click on each address and change it to the new name.

If the browser doesn’t respond when you click OK on changing the name… then add the new computer name to your intranet sites in internet options | Security tab.

Once you’ve changed all 3 applications to the new system name(Central Admin site, SSP site, and default site) you are done.

Some people had trouble with user permissions after that… I did not. If you do, you will need to update your farm admin username to reflect the new machine name.

3.25.2010

Error 6482

Are your SharePoint error logs full of 6482?

error6482

Are your audiences failing to compile?

Did you try resetIIS and that only helped for a little bit, if at all?

Then you need Microsoft Hotfix 946517!!

Available now on web browsers worldwide!!

Get yours today, Click here!

Thanks to this thread: http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/7aeab1ba-0b16-43ee-b0c0-aafcc90ae293

3.18.2010

kickoff/registry hack

well. i hate writing intros so this won't really be one. but i just thought i should start out by saying hi. hi?


**awkward transition**


lately, i've been trying to figure out how to build web parts for sharepoint. almost every article/walkthrough i found referred to sharepoint tools in visual studio. visual studio 2010 (release candidate now available for download) has built-in tools for sharepoint development, and from what i can tell they look pretty cool and versatile. however, i wasn't able to "create" a sharepoint project in 2010 because i don't have a sharepoint server on my machine - and why would i? the other glitch was that the built-in tools are for sharepoint 2010, and i'm currently working with 2007.


new plan: i discovered that microsoft provides sharepoint extensions for visual studio 2008. when i tried installing, i got a similar error - no sharepoint services on my machine (which requires windows server OS). while searching online for a solution, i came across a brilliant registry hack that beautifully accomplished what i needed.


the idea here is to trick your machine into thinking it has sharepoint services installed, which will then allow you to install the visual studio extensions. it took about three seconds to perform, and worked like a charm. i haven't tested it on windows 7, but i know it works on xp and (apparently) vista.


here it is:


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0] "Sharepoint"="Installed"