How to activate email alerts for TFS work items.

In order to activate email alerts for TFS 2013 work items, following two steps are needed. Enable Email alerts on TFS Server: 1) Login to TFS Server. 2) Open TFS Console and check if Email alerts are Enabled. Application Tier –> Email Alert Settings TFS_WorkItem_Alerts1

Click on “Alert Settings” if they are not enabled.

TFS_WorkItem_Alerts2

Enable Email Alerts and enter the details about SMTP Server, Port & Send From Address. You can make changes as needed in above form. Click OK. To test these settings, In TFS Console click this link. TFS_WorkItem_Alerts3 , mention the recipient and optional message for testing.

TFS_WorkItem_Alerts4

If configuration is correct you will receive below message. TFS_WorkItem_Alerts5

TFS_WorkItem_Alerts6

Create Email Alerts for work items in TFS Project Workspace:

Out of the box you cannot create Alerts at Project Collection level but you have to create for each project workspace individually. Open the project workspace site in the browser. TFS_WorkItem_Alerts7

Click on Logged In User Name and than select My Alerts. TFS_WorkItem_Alerts8

On this dialog, click on “Advanced Alert Management Page”. TFS_WorkItem_Alerts9

From this screen you can create different types of alerts which includes: 1) Work item alerts 2) CheckIn alerts 3) Build alerts 4) Code review alerts We will create 2 new Work item alerts (for new work item and modification of any existing work item). Select Project name –> Work item alerts & Click on New on the right pane. TFS_WorkItem_Alerts10

Select the template name from this dialog & click Ok. TFS_WorkItem_Alerts11

Choose defaults and click Ok.

TFS_WorkItem_Alerts12

You can see one alert is created. Now click on “New” once again to create another , this time choose different template & click Ok.

TFS_WorkItem_Alerts13

Choose default on next screen  & Click Ok.

TFS_WorkItem_Alerts14

You can now see two alerts are created.

TFS_WorkItem_Alerts15

Click on “Save” to save these alerts configurations.

How to test if our configuration is successful:

TFS Project Workspace site in browser &  Click on Tasks to create new task for testing. TFS_WorkItem_Alerts16

Enter some information (Title & Assign to yourself) and click on “Save & Close”. TFS_WorkItem_Alerts17

Check your mailbox if you received any email from TFS (the sender account is same as we configured in very first step).

Advertisements

How-To Mount Existing Content DB to a SharePoint Web application

Two scenarios:

1) Web Application already exist and you want to change the Content DB.

2) Web application should be created with existing Content DB.

Let’s look at them one by one.

1: Web Application already exist and you want to change the Content DB:

It’s better to stop the application pool for this web application from IIS.

Delete the Content DB (if you don’t need it).

Open the SharePoint Management Shell (with elevated privileges) and run the following PS Command:

Mount-SPContentDatabase -Name WSS_Content_DB_ToAttach -WebApplication http://mywebapplication:port

The above command will attach the content Database and now execute the below PS command in same window.

Upgrade-SPContentDatabase

This command will upgrade the DB to the final version of your SharePoint Farm.

To Learn how to use this command: Upgrade-SPContentDatabase -examples

2: Web application should be created with existing Content DB:

This is very simple. Just mention the name of existing content DB while creating the new Web Application in the Central Admin.

SharePoint-ContentDB

Optionally if desired you can execute the above command to upgrade it.

How to find Content DB Version:

If you dont have the version of the content db then you have to run the following script:

1: SELECT Version, UserName     2: FROM Versions   3: WHERE VersionId = ‘00000000-0000-0000-0000-000000000000’   4: ORDER BY Id DESC

or open the version table directly (Not recommended).

SELECT *

FROM Versions

WHERE VersionId = ‘00000000-0000-0000-0000-000000000000’

ORDER BY Id DESC

More About SharePoint Versions:

The below links could help you to find what is latest version released by Microsoft.

SharePoint 2010: http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=224

SharePoint 2013: http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=346

Fixing Missing TFS 2013 Project Portal Site

If you missed Project Portal Site creation while creating new project on TFS 2013 or you faced errors (most of the time permission issues with SharePoint), you can follow below steps to create Project Portal Site after a Project is created in TFS 2013.

TFSPPortal-1

The above image is showing a Project without Project Portal link under Activities.

We can divide this process into two steps:

1) Creating a Missing site

2) Linking newly created site with Project Workspace

Assumption: TFS 2013 & corresponding SharePoint 2013 is configured already and you are familiar working with both of them.

1: Creating Missing site

Note: To create Project Portal site, you should be a site collection administrator (When you create Project Collection in TFS, it creates Corresponding Site Collection in SharePoint 2013).

First thing you need is Project Collection (Site Collection) URL.

If you don’t know what is Site Collection URL, you can find it by Opening TFS Console as shown below.

TFSPPortal-3

In TFS Console –> Application Tier –> Team Project Collections

Select Project Collection Name in right pane and it will show you some tabs in the bottom, on the “SharePoint Site” tab, you can find Current default site location.

Open the URL in the browser.

For example: http://ServerName/Sites/

TFSPPortal-2

Click on Site Content

TFSPPortal-4

Click on “new subsite”

TFSPPortal-5

Enter Title of your project but description is optional.

In Website Address –> URL Name , try to enter the same URL as of your current Project Workplace site , it will help in later steps when we will link/integrate Project Portal with Project workspace site.

For example if your Project Workspace URL ends with /Project1 then enter /Project1 in above step.

Leave the default selected and click on Create Button. Upon successful completion you will see new page as below.

TFSPPortal-6

2: Linking newly created site with Project Workspace

Open Visual Studio 2013/2012 and using Team Explorer , choose the desired project.

TFSPPortal-7

Click on Settings

TFSPPortal-8

Click on Portal Settings

TFSPPortal-9

Enable Team Project Portal and click on Configure URL (Note: this step can also be used to change the Project Portal URL if it was created already).

TFSPPortal-10

It will automatically select the SharePoint Site we created in Step 1 , because we choose the same path.

Click Ok

TFSPPortal-11

Enable Reports & dashboards…. Checkbox (optional, if you want to configure TFS Reports using SSRS).

Click OK and we are done.

Open Project workspace site again and you will find the link in the Activities section.

TFSPPortal-12

Hope this will help you.

Fixing SQL Server issues using Named Pipes

Recently we get stuck with an issue in Our Production SQL Server instance while moving the cluster instance to another node.
Experienced DBAs knows that SQL Sever has it’s own Logs folder however there are multiple ways to find this folder, some of them are described here.

Upon reviewing several error logs, we came to know that while adding multiple Data files for TempDB to improve performance , the DBA has mistakenly duplicated the logical file name and same name was assigned to two different physical files for TempDB.

Below are some findings from logs.

2015-03-24 16:20:23.21 spid9s      Starting up database ‘tempdb’.
2015-03-24 16:20:23.47 spid9s      Error: 1828, Severity: 16, State: 1.
2015-03-24 16:20:23.47 spid9s      The logical file name “tempdbDatafile3” is already in use. Choose a different name.
2015-03-24 16:20:23.48 spid9s      SQL Trace was stopped due to server shutdown. Trace ID = ‘1’. This is an informational message only; no user action is required.

To fix this issue we have done the following:

1) Inform all the clients to take their systems into maintenance mode which are connected with this SQL Server instance.

2) Open SQL Server Configuration Manager  and disable the TCP/IP. This will help in running SQL Server in Single User Mode & avoid connections coming to this instance. Our Service was already failing to start.

1

3) Open 2 command prompt with elevated privileges and run this command in 1st window: sqlservr -s MSSQLSERVER -c -f

You may face the error below.

2

To find the location of sqlservr.exe in the registry, the key name is “SQLBinRoot” and path is :

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\Setup

here MSSQL11.MSSQLSERVER is name of your instance.

Copy the value of “SQLBinRoot” which could be like : C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL\Binn (this path may varies due to version difference).

Execute above command:

3

Once its started, scroll down and try to find Pipes connection end point:

4

Copy this connection string (\\.\pipe\MSSQL$SQL2008\sql\query in above example). This will very according to version and named instance configuration.

More about Named Pipes can be found here.

In 2nd Command prompt window run this command: sqlcmd -S \\.\pipe\MSSQL$SQL2008\sql\query

If you face below error, try stopping sql server and restarting again in first window (simply Press Ctrl+ C and press Y to stop it).

6

In second attempt we are able to connect.

Now to find the files related to TempDB, execute the following command.

select name, physical_name from sys.master_files where name like ‘%temp%’;

go;

7

It will show you files list and you can identify the issue (Duplicated logical name found tempdbDatafile3)

To remove this file because we cannot rename in our case due to duplication run below command.

alter database tempdb remove FILE tempdbDatafile3;

go;

Run select command again to verify if file is deleted.

8

After verification stop/close all command windows, enable the TCP/IP pipes in SQL Server configuration  manager and start SQL Instance Service.

Read Move about Alter database file command.

Enjoy SQL Servering…