Howto configure client alias for SQL Server

This post will show you how to configure client aliases for SQL Server. One of the security hardening measures is configuring non-standard port for SQL Server instances.

A default instance of SQL Server listens for connections on TCP port 1433. If a client computer is unable to connect to the database on TCP port 1433, it queries the SQL Server Resolution Service on UDP port 1434.

To protect the database server, you can block the standard ports used by SQL Server and configure your SQL Server instances to listen on a nonstandard port.

Configuring client aliases for SQL Server

0. Open SQL Server Configuration Manager, and expand the SQL Native Client Configuration node.

1. Right-click Aliases, and then click New Alias.

2. In the Alias Name box, type the alias you wish to use when connecting to the database server.

3. In the Port No field, type the port number that you assigned to your SQL Server instance.

4. In the Server field, type the name of your database server.

5. Click Apply, and then click OK.

Alternatively

Start, Run, clicnfg

Enable TCP/IP protocol

Clicnfg


Select properties


Select Alias Tab


Configure client aliases on your WFE servers and application servers using the above steps. You must install SQL Native Client and SQL Server Configuration Manager on each server.

Unattended SQL Server 2005 Installation

This is Part 2 of the 100% Scripted MOSS Installation. In Part 1 of the series, MOSS was installed on SQL SERVER 2005 Express edition. In this series, we will install SQL SERVER 2005 Enterprise Edition using a script, followed with a recap of installation of MOSS and then configuring MOSS using scripts. This will be a shorter journey, since we have seen various permutations in the earlier series.

I have used the instructions from MSDN to configure and install SQL Server 2005 Enterprise Edition.

start /wait C:\BUILD\Packages\MOSS\SQL2005\Servers\setup.exe /qb ADDLOCAL=Client_Components,Connectivity,SQL_Documentation,SQL_Tools90

start /wait C:\BUILD\Packages\MOSS\SQL2005\Servers\setup.exe /qb INSTANCENAME=MOSS2007 ADDLOCAL=SQL_Engine SAPWD=password SQLACCOUNT=domain\sqlserviceaccount SQLPASSWORD=password AGTACCOUNT=domain\sqlserviceaccount AGTPASSWORD=password SQLBROWSERACCOUNT=domain\sqlserviceaccount SQLBROWSERPASSWORD=password SECURITYMODE=SQL

As in earlier series, application installation packages are in

C:\Build\Packages\MOSS\ and copy your SQL SERVER 2005 CD to

C:\Build\Packages\MOSS\SQL2005\

Then apply Service Packs

start /wait C:\BUILD\Packages\MOSS\SQLSERVER2005SP1-KB913090-x86-ENU.exe /allinstances /quiet

start /wait C:\BUILD\Packages\MOSS\SQLSERVER2005SP2-KB921896-x86-ENU.exe /allinstances /quiet

/allinstances /quiet applies service pack to all instances quietly

You can download the scripts from my sky drive

For further customized options you can refer to MSDN Article here.

Next recap of MOSS Installation.

SharePoint: Howto disable editing sites with SharePoint Designer

I just saw this Microsoft KB here. This is very interesting – prevent users from using SharePoint Designer to modify your site!

To quote the exact article, it details steps you can undertake to prevent users from changing a Windows SharePoint Services 3.0 site or a SharePoint Server 2007 site by disabling the authoring feature in SharePoint Designer 2007.

All you have do is edit the Onet.xml file.

By default, the Onet.xml file for Windows SharePoint Services 3.0 and for SharePoint Server 2007 is in the following folder:

\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\SiteTemplates\<Service>\xml

Note Replace the <Service> placeholder with the name of the Windows SharePoint Service that is installed on the server.

On the server that is running Windows SharePoint Services 3.0 or SharePoint Server 2007, locate the site template that you want to modify. Site templates are located in the following folders on the server:

•SharePoint Team Site: Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extentsions\12\Template\LangID\STS\XML.

•Meeting Workspaces: Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extentsions\12\Template\LangID\MWS\XML

Note Replace the Drive placeholder with the drive where Windows is installed. Replace the LangID placeholder with the language version of Windows SharePoint Services 3.0 that is installed on the server.

2.Right-click the Onet.xml file, click Open With, and then click Notepad.

3.Locate the Project Title tag, and then add the following line:

DisableWebDesignFeatures=wdfopensite

Then, click Save.
The complete Project Title tag is as follows:

<Project Title=”Team Web Site” ListDir=”Lists” xmlns:ows=”Microsoft SharePoint” DisableWebDesignFeatures=wdfopensite>

4.Restart Internet Information Services (IIS). To do this, follow these steps:

a.Click Start, click Run, type cmd, and then click OK.

b.At the command prompt, type iisreset computer_name /restart, and then press ENTER.
Note Replace the computer_name placeholder with the name of the computer that is running IIS.

After you follow these steps, users who try to open a site that is based on the site template that has the DisableWebDesignFeatures=wdfopensite attribute will receive the following message:

This web site has been configured to disallow editing with FrontPage. Contact your web site administrator for more information

By default, if you try to change a Windows SharePoint Services 3.0 site or a SharePoint Server 2007 site by using Microsoft Office FrontPage 2003, you receive the following error message:

Web Site Editing is Disabled. This web site has been configured to disallow editing with FrontPage. Contact your web site administrator for more information.

Source | Microsoft KB

SharePoint: Remove Windows Internal Database

If you have uninstalled Windows SharePoint Services v3, you cannot be sure that the Windows Internal Database (SQL Embedded Edition) has been deleted.

Reason: It’s not listed in Add/Remove programs.

All you have to do is run this command and it’s all sorted for you.

• If you are running an x86-based edition of Microsoft Windows Server 2003, use the following command line to remove Windows Internal Database from the computer:

msiexec /x {CEB5780F-1A70-44A9-850F-DE6C4F6AA8FB} CALLERID=ocsetup.exe

• If you are running an x64-based edition of Windows Server 2003, use the following command line to remove Windows Internal Database from the computer:

msiexec /x {BDD79957-5801-4A2D-B09E-852E7FA64D01} CALLERID=ocsetup.exe

I have done this many times and can vouch for this KB method.

Alternative method has been referenced by DecipherInfosys.

Personally, I like the KB method, it’s straight forward.

Do you agree with that?

SharePoint: Migration from WSSV2 to WSSV3

This is going to be a challening task and I am going to test this over the weekend. I wrote about moving WSSV2 MSDE database to WSSV3 SQL Embedded Edition earlier and step # 1 was to use the pre-scan tool.

Quick re-cap of that step:

Use the Prescan.exe tool to scan the WMSDE content database on the WSS server. Note You must run the Prescan.exe tool on the WSS database to prepare the database to be added to the WSS 3.0 Web application.

To use the Prescan.exe tool to scan the WSS database, follow these steps:

  • Use an account that has administrative permissions to log on to the WSS server.
  • Copy the Prescan.exe tool on the WSS 3.0 server to a folder on the WSS server.
    Note The Prescan.exe tool is located on the WSS 3.0 server in the following folder: Program FilesCommon FilesMicrosoft Sharedweb server extensions12BIN
  • Click Start, click Run, type cmd, and then click OK.
  • Locate the folder to which you copied the Prescan.exe tool.
  • At the command prompt, type the following command to scan the database: prescan /all

Doing a prescan before migration is imperative. You have to do it :-)

Why pre-scan?

The pre-upgrade scan tool scans your sites and reports issues, which enables you to fix any errors before you perform an upgrade. If you have not successfully run this tool and you attempt to upgrade your environment, when you attempt to run the SharePoint Products and Technologies Configuration wizard, the wizard will exit and prompt you to run the tool.

How do I get the pre-scan tool?

Download the tool and accompanying documents from here.

SharePoint: Move WSSv2 MSDE DB to WSSv3

If you want to move your WSSv2 MSDE DB to WSSv3, these steps and scripts are just what you need.

Microsoft KB 925190 explains just that. I have adopted that to script some of the steps.

This is very similiar to WSSv3 Database move from default location to another location as explained in this post.

When you move the WSS database to the WSS 3.0 server, the WSS database is upgraded to WSS 3.0. This occurs when you attach a WSS 3.0 Web application.

To move a WMSDE content database that resides on a WSS server to a WSS 3.0 server, follow these steps:

Use the Prescan.exe tool to scan the WMSDE content database on the WSS server. Note You must run the Prescan.exe tool on the WSS database to prepare the database to be added to the WSS 3.0 Web application.

1. To use the Prescan.exe tool to scan the WSS database, follow these steps:

  • Use an account that has administrative permissions to log on to the WSS server.
  • Copy the Prescan.exe tool on the WSS 3.0 server to a folder on the WSS server.
    Note The Prescan.exe tool is located on the WSS 3.0 server in the following folder: Program FilesCommon FilesMicrosoft Sharedweb server extensions12BIN
  • Click Start, click Run, type cmd, and then click OK.
  • Locate the folder to which you copied the Prescan.exe tool.
  • At the command prompt, type the following command to scan the database: prescan /all

2. On the WSS 3.0 server, create the following folder structure under the Windows folder:

SYSMSISSEEMSSQL.2005MSSQLData

3. Use the Osql command to connect to the WSS database. To do this, follow these steps:

  • At the command prompt, type the following command, and then press ENTER:

Osql –S Servernamesharepoint -E

Note In this command, Servername is the name of the WSS server.

  • At the 1> prompt, type the following command, and then press ENTER:

EXEC sp_detach_db contentDB name

Note In this command, contentDB name is the name of the content database.

  • At the 2> prompt, type Go, and then press ENTER.

Note You may receive a message that resembles the following:

database is in use and cannot be detached

  • If you receive this error message, type the following commands at the command prompt in the order in which they are presented.

net pause mssql$sharepoint

net continue mssql$sharepoint

4. Copy all the .mdf and .ldf files that are located in the WSS database to following folder on the WSS server:

WINDOWSSYSMSISSEEMSSQL.2005MSSQLData

5. Use an account that has administrative permissions to log on to the WSS 3.0 server.

6. On the WSS 3.0 server, download and install the Microsoft SQL Server Native Client and the Sqlcmd utility.

7. On the WSS 3.0 server, run the following command at the command prompt:

sqlcmd -S \.pipemssql$microsoft##sseesqlquery -E

8. At the 1> prompt, type the following command, and then press ENTER:

EXEC sp_attach_db @dbname = N’contentDB name‘, @filename1 = N’D:WINDOWSSYSMSISSEEMSSQL.2005MSSQLDatacontentDB name_1.mdf’, @filename2 = N’D:WINDOWSSYSMSISSEEMSSQL.2005MSSQLData contentDB name_1_log.ldf’

Note In this command, contentDB name is the name of the content database.

9. At the 2> prompt, type Go, and then press ENTER:

10. On the WSS 3.0 server, create a Web application to attach to the database.
If you have already created a new Web application, you must use the Manage Content Databases page to remove the content database from the Web application. This lets you add the migrated database from the WSS server. To do this follow these steps:

  • On the WSS 3.0 server, click Start, point to Administrative Tools, and then click SharePoint 3.0 Central Administration.
  • On the Central Administration page, click Application Management.
  • On the Application Management page, click Content Databases.
  • On the Manage Content Databases page, click the Web application that you want.
  • Click the name of the new database that was created when you created the Web application.
  • On the Manage Content Database Settings page, click to select the Remove content database check box, and then click OK.

11. Use the Stsadm.exe command-line tool to attach the WSS database to the Web application. Windows SharePoint Services does not support using the Manage Content Databases page to add a WSS database to a Web application. Therefore, you must use the Stsadm.exe command-line tool to add the Windows SharePoint 2.0 database to the Web application.
To do this, follow these steps:

a. At the command prompt, locate the following folder:

Program FilesCommon FilesMicrosoft Sharedweb server extensions12BIN

b. At the command prompt, type the following command for more information about how to use the Stsadm.exe command-line tool.

stsadm -help addcontentdb

The following output is generated:

stsadm.exe -o addcontentdb
           -url url
           -databasename <database name>
           [-databaseserver <database server name>]
           [-databaseuser <database username>]
           [-databasepassword <database password>]
           [-sitewarning <site warning count>]
           [-sitemax <site max count>]

Note In this text, url is the url of the WSS 3.0 Web application to which you want to add the database.

Note: If you want to script steps 3 and 4 and 7 through to 9, then create 3 scripts as follows, after you have done step 7.

All installation files will be in C:WSSV3 for reference from now on.

Script to install the Microsoft SQL Server Native Client and the Sqlcmd utility.

c:wssv3sqlncli.msi /qn

c:wssv3sqlserver2005_sqlcmd.msi /qn

After installation, you will find the utility installed in the following location:

C:Program FilesMicrosoft SQL Server90Toolsbinn

Remember you have done step 2 of creating Data folder, which should be

%windir%sysmsisseeMSSQL.2005MSSQLData

Script to stop MSSQL$sharepoint, copy, detach, move and attach database

net pause mssql$sharepoint

copy <your wssv2 database files> c:SharePointv3Database*.*

net continue mssql$sharepoint

sqlcmd -S \.pipemssql$microsoft##sseesqlquery -E -i c:s2.sql

If you see there is another scipt that is s2.sql. This script is to actually detach and attach the database. I am making an assumption that, this database name is WSS_Content.

Script to detach and attach WSS database

EXEC sp_detach_db @dbname = ‘WSS_Content’

go

EXEC sp_attach_db @dbname = ‘WSS_Content’, @filename1 = ‘%windir%sysmsisseeMSSQL.2005MSSQLDataWSS_Content.mdf’, @filename2 = ‘%windir%sysmsisseeMSSQL.2005MSSQLDatawss_content_log.ldf’

go

That’s it! If you have migrated from WSSv2 to WSSv3, I would like to hear from you!

Create 2007 MOSS Theme

This is super cool, must give it a shot. If you want to create your own 2007 MOSS Theme, follow Aris WiBowo’s instructions as under:

Creating Themes in MOSS 2007

  1. On the SharePoint server go to the Themes folder e.g. c:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATEThemes
  2. Make a copy one of the existing theme folders and its contents rename it e.g. MyTheme.
  3. Rename the .INF file within the MyTheme folder to MyTheme.INF
  4. Edit MyTheme.INF.
    1. At the info section change the title to MyTheme. Change codepage, e.g 22200, replacing the code page will fixing error. A theme with the name MyTheme 1011 and version already exists on the server.
    2. In the titles section, rename the names to your new name. this section is to present the name in the different language.
  5. Provide an image to give a preview of your theme. This image should be placed in C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATEIMAGES. E.g. tmbMyTheme.gif
  6. Modify the c:Program FilesCommon FilesMicrosoft Sharedwe server extensions12TEMPLATELayouts1033SPTHEMES.xml to include a reference to the new MyTheme theme

    <Templates>
    <TemplateID>MyTheme</TemplateID>
    <DisplayName> MyTheme </DisplayName>
    <Description> MyTheme has a white background with blue control areas and orange highlights.</Description>
    <Thumbnail>images/tmbMyTheme.gif</Thumbnail>
    <Preview>images/ tmbMyTheme.gif</Preview>
    </Templates>

  7. Modify the CSS within MyTheme folder to personalize your theme.
  8. Run iisreset from the command prompt
  9. Apply the new theme!