Greetings to all you tech-savvy warriors out there. Network troubleshooting isn’t just a task—it’s an art form. But sometimes, technology can make this art a bit less abstract. Today, let’s talk about a PowerShell script that identifies wired Ethernet connections running slower than 1 Gbps.
How the Script Works
Get-NetAdapter
This script uses the Get-NetAdapter cmdlet to fetch a list of network adapters on your system. Get-NetAdapter is a built-in PowerShell cmdlet that retrieves basic and detailed information about the network adapters present in your system.
Where-Object
After fetching the list, the Where-Object statement filters the results based on specific conditions, like omitting virtual network adapters, considering only ‘Up’ or active connections, and focusing only on wired Ethernet connections. This ensures that you’re not spending time analyzing irrelevant data.
Select-Object
Finally, the Select-Object statement formats the output to show only the Name, InterfaceDescription, Status, and LinkSpeed of the network adapters that meet the criteria. This gives you a condensed, easy-to-read output that hones in on the essential details.
The Script: Identify if any wired ethernet connections that are running slower than 1 Gbps
#Requires -Version 5.1 <# .SYNOPSIS Identify if any wired ethernet connections that are running slower than 1 Gbps. .DESCRIPTION Identify if any wired ethernet connections that are running slower than 1 Gbps. This can highlight devices that are connected to old hubs/switches or have bad cabling. .OUTPUTS None .NOTES Minimum supported OS: Windows 10, Server 2016 Release Notes: Initial release By using this script, you indicate your acceptance of the following legal terms as well as our Terms of Use at https://www.ninjaone.com/terms-of-use. Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms. Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party. Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library or website belonging to or under the control of any other software provider. Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations. Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks. Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script. EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA). #> [CmdletBinding()] param () process { $NetworkAdapters = Get-NetAdapter -ErrorAction SilentlyContinue | Where-Object { $_.Virtual -eq $false -and # Filter out any adapter that are Virtual, like VPN's $_.Status -like "Up" -and # Filter out any disconnected adapters ($_.PhysicalMediaType -like "*802.3*" -or $_.NdisPhysicalMedium -eq 14) -and # Filter out adapters like Wifi $_.LinkSpeed -notlike "*Gbps" # Filter out the 1, 2.5, and 10 Gbps network adapters } $NetworkAdapters | Select-Object Name, InterfaceDescription, Status, LinkSpeed if ($NetworkAdapters) { exit 1 } }
Access over 300+ scripts in the NinjaOne Dojo
Benefits of Using the Script
Time-Saving
Manually identifying slow Ethernet connections could take hours, especially in a large enterprise setting. This script automates that process, turning a potential slog into a quick task.
Identifying Potential Problems
By flagging sub-1 Gbps connections, the script helps you identify weak links in your network infrastructure, allowing for proactive remediation before they turn into bigger issues.
Reporting
For those looking to keep tabs on network performance over time, the script can be integrated into automated systems to generate regular reports on slow Ethernet connections.
How to Implement
- Open PowerShell with administrative privileges: Right-click the PowerShell icon and choose “Run as administrator.”
- Copy and paste the script into the PowerShell window: Ensure you’ve copied the entire script accurately.
- Press Enter to run the script: The script will execute, and if it finds any slow Ethernet connections, it will list them for you.
Leveraging NinjaOne for Enhanced Network Management
Automating Script Execution
NinjaOne can automate the execution of this PowerShell script at intervals you specify. This continuous monitoring ensures that you’re always ahead of any potential slowdowns.
Reporting
NinjaOne can also generate concise, easy-to-understand reports based on the script’s output. This could help you trend network speeds over time, identify chronic issues, and even satisfy compliance requirements.
Integration
And let’s not forget, NinjaOne integrates seamlessly with other network management tools you may already be using, thereby creating a unified, centralized management solution.
Final Thoughts
Don’t let slow Ethernet connections be the bottleneck in your team’s productivity. Use this PowerShell script for quick identification and resolution. And if you’re looking to further up your game, leverage the powerful capabilities of NinjaOne to manage, analyze, and future-proof your network infrastructure.