Contents of Guy’s Scripting Ezine 3 – Map Network Drive
This week I was operating outside my usual area of expertise; I needed a CGI (Common Gateway Interface) script for an autoresponder project. Now Guy knows very little about CGI scripts and This Week’s Secret is the CGI code made me feel like a beginner. I wished that there were more remarks or comments to help me understand the purpose of the script I was adapting.
So, I have taken to heart this problem of beginners needing explanations in scripts, and this week I have put in lots of comments to explain what each section is about.
Guy Recommends: The Free IP Address Tracker (IPAT)
Calculating IP Address ranges is a black art, which many network managers solve by creating custom Excel spreadsheets. IPAT cracks this problem of allocating IP addresses in networks in two ways:
For Mr Organized there is a nifty subnet calculator, you enter the network address and the subnet mask, then IPAT works out the usable addresses and their ranges.
For Mr Lazy IPAT discovers and then displays the IP addresses of existing computers. Download the Free IP Address Tracker
There are many learning points in this script
a) Simple mapping network drive method – MapNetworkDrive
b) The logic which disconnects K:\ drive if it is already connected. People often ask me how to check or disconnect a network drive.
c) For, next loops
d) If, then, else statements
Copy the lines following ‘Script starts up to ‘Script ends.
Paste the script into notepad.
Make changes to the value \\alan\home
Remember to save with a .vbs extension.
Double click to test the script
If you like it, then adapt it and assign it to your users
SolarWinds’ Orion performance monitor will help you discover what’s happening on your network. This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.
What I like best is the way NPM suggests solutions to network problems. Its also has the ability to monitor the health of individual VMware virtual machines. If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.
These week’s tip is to place comments in YOUR scripts. In particular, put remarks on the PURPOSE of the script, and the role of each section. The HOW the script is done should be apparent from the variables and the methods.
Each Litmus test is fun, yet has a serious learning point. I am sure that there will be at least one test that will suit you. This week’s litmus test is:
Professionals put comments on the PURPOSE of the script
Amateurs do not use comments in their scripts.