Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to use TSS Tools with Microsoft Support
<# How to use TSS Tools with Microsoft Support #>
<# Pretty Timestamp prompt using dbatools module#>function Prompt{Write-Host "[" -NoNewline; Write-Host (Get-Date -Format "HH:mm:ss") -ForegroundColor Gray -NoNewline;try{$history = Get-History -ErrorAction Ignore;if ($history) {Write-Host "][" -NoNewline;if (([System.Management.Automation.PSTypeName]'Sqlcollaborative.Dbatools.Utility.DbaTimeSpanPretty').Type){Write-Host ([Sqlcollaborative.Dbatools.Utility.DbaTimeSpanPretty]($history[-1].EndExecutionTime - $history[-1].StartExecutionTime)) -ForegroundColor Gray -NoNewline} else{Write-Host ($history[-1].EndExecutionTime - $history[-1].StartExecutionTime) -ForegroundColor Gray -NoNewline;}}}catch { }Write-Host "] $($executionContext.SessionState.Path.CurrentLocation.ProviderPath)" -NoNewline;"> "}
cd $env:temp
$targetTssDir = 'c:\tss_tools'
if (!(Test-Path $targetTssDir)) {mkdir $targetTssDir };
Start-BitsTransfer -Destination .\ -Source ''
Expand-Archive .\ -OutputPath $targetTssDir
cd $targetTssDir
.\tss.cmd SDP:SQLBase
I will also like to collect some logs to review, so could you let me know when was the last time the issue happened and around what time? So we can focus on looking in that time frame for starters.
To gather the required logs, we utilize a Service Diagnostic Package (SDP), which collects SQL Server and system logs that will help us in our analysis. Please follow these steps to download and run the tool:
1.Download the tss_tools zip file from :
2.Copy the zip file to the primary server
3.Unzip the contents of to a folder
4.Open PowerShell as Administrator
5.Change to the directory where the files were extracted
6.Run the following command: .\tss.cmd SDP:SQLBase
7.The tool will start collecting the logs, please wait until all the modules finish:
8.You will get a confirmation message once the diagnostics are completed. The location and name of the resulting zipped file will be displayed. The default path is C:\MS-DATA
9.Please repeat the steps on the secondary node that is having issues, so we can collect the logs from that server as well
10.Once you have both Results_SQLBase zip files, please upload them to the case workspace
cd $($targetTssDir) ; .\tss.cmd SDP:SQLBase
***Delete TssTools files - copy your ZIP files from C:\MS-DATA first***
cd \; rd -Recurse -Force $($targetTssDir), C:\MS_DATA; Remove-Item "$($env:temp)\"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment