Analysis – Concurrent Connections to Web Front End – SharePoint 2013

If you are intereted to find the number of connections on your WFE and want to analyze later you can use the script below.  This script will run every 5 minutes
$FilePath = "E:\Scripts\Connections.csv"
$Content = Get-Content $FilePath -ErrorAction SilentlyContinue
$String = ""
if($Content.Length -eq 0)
    $String = $Header
$Date = Get-Date -Format d
$Time = Get-Date -Format t
Get-WmiObject -Class Win32_PerfFormattedData_W3SVC_WebService -ComputerName Server1,Server2,Server3,Server4 | Where {$_.Name -eq "_Total"} | % `
    $ServerName = $_.__SERVER;
    $Connections = $_.CurrentConnections
    $String +="`r$ServerName,$Date,$Time,$Connections"
    Write-Host "$ServerName : $Connections" 
Out-File -InputObject $String $FilePath -Encoding ascii -Append -Force 

Scheduled Task XML

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="">
    <Principal id="Author">
 <Actions Context="Author">
      <Arguments>-ExecutionPolicy Bypass E:\Scripts\Update-CSVForConnections.ps1</Arguments>
One you set it up in task schedular it will write to CSV every 5 minutes which you can take out in Pivot chart todo an analysis.


This can show you how your WFEs are performing at different times of day.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s