Network Device Status Monitor
PowerShell based network attached device monitor
Network Device Status Monitor can also be downloaded from:
- The Microsoft TechNet Gallery
- The PowerShell Gallery
- For full instructions and documentation, visit my blog post
Tweet me if you have questions: @Digressive
Features and Requirements
- The utility will display the network device name and IP address as specified in the CSV file.
- The utility will display Online/Offline status of the specified devices.
- The utility will display the response time of the network device.
- The utility can display the results as either a CSV file or a HTML file.
- The utility can be configured to monitor continuously, or run once.
- The utility can be configured to e-mail the results.
- The script has been tested running on Windows 10 and Windows Server 2016, monitoring network devices with IP v4 addresses.
CSV File Structure
The structure of the CSV file is as follows:
IP,Name 10.30.1.1,Router 10.30.1.5,NAS 10.30.1.10,Switch 1
The utility has been tested running on Windows 10 and Windows Server 2016, monitoring PCs and Servers running Windows 10, Windows Server 2016, Windows Server 2012 R2, and Windows Server 2008 R2. The utility must be run as a user with administrator-level privileges to the systems it is monitoring.
Generating A Password File
The password used for SMTP server authentication must be in an encrypted text file. To generate the password file, run the following command in PowerShell, on the computer that is going to run the script and logged in with the user that will be running the script. When you run the command you will be prompted for a username and password. Enter the username and password you want to use to authenticate to your SMTP server.
Please note: This is only required if you need to authenticate to the SMTP server when send the log via e-mail.
$creds = Get-Credential $creds.Password | ConvertFrom-SecureString | Set-Content c:\scripts\ps-script-pwd.txt
After running the commands, you will have a text file containing the encrypted password. When configuring the -Pwd switch enter the path and file name of this file.
Here’s a list of all the command line switches and example configurations.
The path to a CSV file with a list of IP addresses and device names to monitor separated by a comma.
The path where the HTML or CSV report should be output to. The filename will be NetDev-Status-Report.html/csv.
The number of seconds that she script should wait before running again. The minimum is 300 seconds (5 minutes) and the maximum is 28800 (8 hours). If not configured the script will run once and then exit.
Use a light theme for the web page generated. This setting had no effect on a CSV file report.
Output a CSV file instead of a HTML file for the report.
The e-mail address the log should be sent to.
The from address the log should be sent from.
The DNS or IP address of the SMTP server.
The user account to connect to the SMTP server.
The txt file containing the encrypted password for the user account.
Connect to the SMTP server using SSL.
NetDev-Status.ps1 -List C:\foo\networkdevices.csv -O C:\foo -Refresh 300 -Light
The script will execute using the list of network devices and output a html report called NetDev-Status-Report.htm to C:\foo. The status of the network devices will refresh every 5 minutes, and the web page will have a light theme instead of a dark theme.