My colleague Jeff Brown has already covered the reason for running a network assessment. He also covered how to run the assessment. I’d now like to show you how you can automate the process and scale it so that you can collect data from multiple end-points, or even sites. You can read more about Jeff’s network assessment info on the Perficient blog:
https://blogs.perficient.com/microsoft/2017/02/skype-online-why-you-need-a-network-assessment/
https://blogs.perficient.com/microsoft/2017/03/skype-online-how-to-run-a-network-assessment/
The free Skype for Business Network Assessment Tool measures network performance and network connectivity. Like most free tools, this one is limited in functionality. It does measure latency, packet loss, jitter, and packet reorder percentage all of which are important. Some downsides to the free tool include the following:
- The requirement for an end-user to start the process.
- The ability to run only a single assessment due to the fixed output file which is overwritten.
- The need to modify a cofig file to change options.
So how do we overcome these limitations? By using the Windows Task Scheduler and a bit of PowerShell scripting we will automate the assessment.
Let’s start by downloading the tool and having a look. You can download the Skype for Business Network Assessment Tool from here – https://www.microsoft.com/en-us/download/details.aspx?id=53885.
The download is a single install file and there is no option to pick the install directory. The files are extracted to the “Program Files\Microsoft Skype for Business Network Assessment Tool” directory. You can copy the files to a different location or go with the default. You can also copy the extracted files to different computers.
Prior to running the tool, you need to get a better understanding of your user community. How does your company use Skype for Business or Teams? There are a lot of basic questions you want to ask. Here are just a few:
- Do we use audio, video, conferencing or PSTN calling?
- Is there a Quality of Service (QoS) policy and support in place?
- What are the hours of operation, and the number of sites that need to be evaluated?
Let’s start by looking at the config file. Look for the file named NetworkAssessmentTool.exe.config.
Open the file in Notepad, the values we want to modify are the “NumIterations” and the IntervalInSeconds. Assuming we want to run an assessment every 30 minutes over a 12-hour period we need to set the NumIterations to 24 and the IntervalSeconds to 1800.
<add key="NumIterations" value="24"/> <add key="ResultsFilePath" value="C:\Networkassessment\performance_results.tsv"/> <add key="Delimiter" value=" "/> <add key="IntervalInSeconds" value="1800"/> <add key="OutputFilePath" value="C:\Networkassessment\connectivity_results.txt"/>
This covers us for a single day. What happens if you want to you want to run this tool on more than one day, say Monday through Friday? The output file name is configurable but remains static based on the config file. The next run of the analysis tool will overwrite the current data file which means you could lose the prior day’s data. This solution is obviously not scalable and requires a lot of manual intervention. This is where we can leverage the Windows Task Scheduler and a bit of PowerShell to automate the process.
Let’s have a look at the PowerShell Script. It is used to start the network assessment and rename the output file prior to the next iteration. The script is used to invoke the network assessment tool and then rename the output when done.
<# =================================================== .NOTES Organization: Perficient Inc. Filename: NetworkAssessment.ps1 =================================================== PowerShell script to automate the Microsoft Network Assessment Tool Step 1 - Create NetworkAssessment folder at root of C: Step 2 - Copy network assessment PowerShell script to install directory of the network assessment tool Step 3 - Create scheduled task to run the PowerShell(AS SHOWN BELOW) Step 4 - Modify network assessment config file parameters powershell -nologo -noninteractive -command & ("{C:\Program Files\Microsoft Skype for Business Network Assessment Tool\NetworkAssessment.ps1}") #> <# Start the Network Assessment Process Wait for process to complete before renaming the file in order to prevent overwriting prior data #> push-location "C:\Program Files\Microsoft Skype for Business Network Assessment Tool"; $exe = "NetworkAssessmentTool" $proc = (Start-Process $exe -PassThru) $proc | Wait-Process <# Rename output file #> Get-Item C:\Networkassessment\performance_results.* | Rename-Item -newname {$_.LastWriteTime.toString("yyyy.MM.dd.ThhmmZ") + ".tsv"}
Next, we need to automate the network assessment so that is runs on a schedule. This is where the Windows Task Scheduler plays its role. We need to invoke PowerShell to start the assessment and then re-name the output file.
- Start by creating a folder called Network Assessment. Next, create a scheduled task and give it a name.
- Create the task and set it to run under an account that has administrator permissions on the local computer. Select the option to run whether a user is logged in or not.
- Select the Triggers tab and specify the start and end date and time for running an assessment. Be sure to check the box to enable the trigger.
- Select the Actions tab and click the New… button. This is where we execute the PowerShell script to run the assessment. The program to run is PowerShell.exe. For the add arguments field you need to use the following: “& ‘C:\Program Files\Microsoft Skype for Business Network Assessment Tool\NetworkAssessment.ps1′”
- Lastly, you will want to wake the computer if it goes into a sleep, or power saving mode. Ideally, you want to exclude the computer from any group policies that prevent the assessment from running as expected.
Once the task is executed for the first what can you expect? How do you know it is working? You will need to check the output file directory from the config file. Based on the configuration file, we should see a file called performance_results.tsv. It will then be renamed to the date and time format following the completion of the daily network assessment.
If you open the file in Excel you should see some data being collected. I will cover how to make sense the data on a different blog.
CallStartTime | PacketLossRate | RoundTripLatencyInMs | PacketsSent | PacketsReceived | AverageJitterInMs | PacketReorderRatio |
2/15/2018 7:52 | 0 | 21 | 851 | 851 | 6.456347 | 0 |
2/15/2018 7:53 | 0 | 21 | 851 | 851 | 4.320866 | 0 |
2/15/2018 7:53 | 0 | 21 | 283 | 281 | 3.147392 | 0 |
2/15/2018 7:54 | 0 | 21.5 | 283 | 283 | 2.805307 | 0 |
2/15/2018 7:54 | 0 | 21 | 851 | 851 | 8.556069 | 0 |
Hi, very nice tool. There is a new tool now called Microsoft Teams Network Assessment Tool. Do you have any way to use it with a scheduled task?