SQL Move TempDB

I always forget the code to do this because I do it so rarely.  If you want to move the location of TempDB for SQL Server do this:

 USE master
GO
ALTER DATABASE
tempdb
MODIFY FILE (NAME = tempdev, FILENAME = '{new location}\tempdb.mdf')
GO
ALTER DATABASE
tempdb
MODIFY FILE (NAME = templog, FILENAME = '{new location}\templog.ldf')
GO


Then restart the SQL Server services.

Moving Windows Internal Database

Windows Internal Database (or SQL Server Embedded) can be used by WSS or Windows Software Update Services (WSUS).  It is well hidden and annoyingly unmanageable.  By default the data files reside in a folder under the root drive in the Windows directory.  This can be a bad place to allow a potentially fast growing database to reside… especially if your drives are partitioned for a small “C” drive just to be used by the operating system.  I was able to find out how to move these databases pretty easily.

1. Download and install SQL Server Management Studio Express (find it here: http://tiny.cc/msssmse)
2. Turn off any services that might be using the database (SharePoint, WSUS, etc)
3. Connect to \\.\pipe\mssql$microsoft##ssee\sql\query using SSMSE named pipes
4. Detach all databases that you wish to move (check box to kill connections)
5. Move the databases and associated log files (MDF & LDF) to the desired location
6. Reattach databases in there new location

Now the databases will not hog your boot drive.

Server Alias/Name Resolution WSS

An interesting but frustrating thing occurred a few months back when I was creating a SharePoint WSS server installation at work.  We had created an alias for the server but the name would not stick.  You could browse to the server but whenever you clicked a link within SharePoint it would take you to the page with the name of the server in the URL not the alias.  The same would happen when using the IP address, NetBIOS name, or the FQN. 

Solution… the Alternate Access Mappings link within SharePoint Central Administration.  Set up all the possible names that people may type into to get to a place within SharePoint and that name will stick.

Max List Template Size

In SharePoint (MOSS 2007 & WSS 3.0) there is a limit on the size of list template that can be saved… 10MB.  For most lists that just contain data this is sufficient.  There may be a need for lists that have attachments or document libraries that may contain many documents.  SharePoint lets you increase this size to a maximum of 500MB by running the following command at the prompt:

stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 50000000

IIS Gone after MOSS 2007 Install

I noticed the other day that IIS management was not connecting shortly after an enterprise MOSS 2007 installation.  I know a few colleagues at work had mentioned seeing this before as well.  I went on the hunt and came across a well hidden paragraph in an article about IIS in general that gave me the solution.  Apparently all you need to do is stop and restart the SharePoint timer service.  That is it!  Amazing how simple the solution can be for an issue that has caused so many people to jump through hoops for workarounds!

SharePoint STSADM Helper

I ran across a great suite of tools offered for the STSADM command line SharePoint administration tool.  It is a helper class written by Gary LaPoint MOSS MVP.  Great features and nice documentation. 

Here is his blog: http://stsadm.blogspot.com/

And here are the tools: http://stsadm.blogspot.com/2009/02/downloads.html

Turn off Hibernate in Vista

Switching Hibernate on/off in Windows XP was easy, go to control panel then power options and the last tab gave you options for Hibernate.  IN Vista it is a different story… they removed the option altogether from the power setting dialogs.  If you are like me and do not use this feature open a command prompt and execute the following:

powercfg.exe /hibernate off



This will not only turn off Hibernation, but will also give you back anywhere from 2-4 GB of disk space.

SQL Pinhole for WSS/MOSS Installation

I am a big supporter of a multi-tiered environment when developing large applications especially in a corporate environment.  I don’t just mean having different class libraries for data access/business logic I mean true physical separation between the web server and the database server.  When I installed a quick sandbox site of WSS for work I just let the installation steps guide me through the installation.  Apparently with WSS 3.0 this creates an instance of Windows Internal Database.  This is even more stripped down than SQL Server Express edition I guess!  But, I was still able to connect to it using SSMS… so it wasn’t a total loss.

When creating the production environment I wanted to do it right.  I wanted SQL to run on our corporate DB server tuned for database activity and WSS to have a dedicated web box configured specifically for serving up web applications in ASP.Net.  A simple install proved that this was not easy… just specifying the database server on install was not enough, especially since this was not a default instance of SQL server but one of many.  I found a document buried in the MSDN library indicating that I needed to create a “Pinhole” for SQL to be seen by WSS.  Here is what I did:

First I needed to create a System DSN for the SQL server instance giving it simply the name of the server (no port number on it either):

image

Second on the next screen you will need to click the “Client Configuration…” button:

image 

Third you will need to add the port number of the instance created (make sure TCP/IP is selected):

image

If you are unsure of the port number an SQL instance is using you will need to open up SQL Configuration Utility and browse to the TCP/IP configuration window and look at the second tab bottom.  There are two fields for ports here “TCP Dynamic Port” and “TCP Port”.  The Dynamic port is the one you want unless you need to set your own port… if so change the “TCP Port” field and click OK… you will need to restart the SQL services for this to take hold.

When done setting the port click OK and step through the rest of the DNS configuration wizard.  Test the connection to make sure that it works.  Now all you will need to do in WSS is specify the server name exactly how you did on the first screen on the DSN wizard and all should be good!

WSS 3.0 Rebranding

I was recently given the task of rebranding our WSS production server at work to rid ourselves of the ugly WSS / MOSS header with the three peg-people they use.  This is a relatively easy task in MOSS but not so easy in WSS.  On the server in the folder “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL” there is a file “Default.master”.  If this file is edited it will impact ALL sub webs created under ALL site collections in WSS.  It will also impact existing sub webs.  Altering the “Application.master” file in the “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS” folder will rebrand the administration pages.  Be careful changing either of these as SharePoint is very picky about objects existing on the page when it loads the dynamic content.

If you want only to rebrand a singe site at a time you will need SharePoint Designer 2007.  If you browse to the site that you want to edit and look for the “Default.master” file in the masterpage directory and edit it SharePoint will create a ghosted copy of the file.  That site will show the changes, but not its children or any other sites created/existing.  To revert back just right click the edited file and choose “Reset to Site Definition”.

Disabling Themes WSS 3.0/MOSS 2007

If you have a need to tighten the visual standards on SharePoint WSS & MOSS you can easily disable the themes available to site owners so your site collection does not look like something out of Willy Wonka’s chocolate factory.  To do this simple use you favorite XML editing tool and open up the file “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\SPTHEMES.XML” and comment out any of the theme blocks you do not want to show:

<?xml version="1.0" encoding="utf-8"?>
<!--
_lcid="1033" _version="12.0.4518" _dal="1" -->
<!--
_LocalBinding -->
<
SPThemes xmlns="http://tempuri.org/SPThemes.xsd">
<
Templates>
<
TemplateID>none</TemplateID>
<
DisplayName>Default Theme</DisplayName>
<
Description>
The default theme has a white background with blue control
areas and orange highlights.
</Description>
<
Thumbnail>images/thnone.gif</Thumbnail>
<
Preview>images/thnone.gif</Preview>
</
Templates>
<!--
<Templates>
<TemplateID>classic</TemplateID>
<DisplayName>Classic</DisplayName>
<Description>
Classic has a white background with blue control areas
and orange highlights.
</Description>
<Thumbnail>images/thclassic.gif</Thumbnail>
<Preview>images/thclassic.gif</Preview>
</Templates>
-->
</
SPThemes>



Vista Parental Controls on a Domain?

After Vista has been joined to a domain you lose a few things like Parental Controls & some Media Center capabilities unless you manually re-enable them.  To do this for the Parental Controls go to group policy editor (start > run > gpedit.msc), then to Computer Configuration > Administrative Templates > Windows Components > Parental Controls.  Enable the setting “Make Parental Controls control panel visible on a Domain”:

image