One of my script mentors taught me that a trick to writing good script code is to make it handle errors gracefully. He always thought that 25 percent of the code in a script should accomplish the task and 75 percent should handle errors. Although I think his percentages might have been flawed, he has a point. Some utilities and commands take a long time to timeout if they're run against a nonexistent node. If you have many nodes in your input list that don't respond, these combined timeout errors can make a script take a long time to complete. Also, not having sufficient rights on the remote node to run a command or utility against a remote node could cause a long timeout.
You should always check whether a node is online before you query it for information. Optionally, performing a rights test isn't a bad idea, either. Traditionally, I've used a Ping test, run Nbtstat, or tested the C$ admin share to check whether a node is online. The GetBiosDate script includes code to perform the C$ test, which you can see at callout A in the main article's Listing 1. In the 11 "mini" scripts, I've added the code to determine whether the path to the C$ default administrative share exists. This is a simple double test: It reveals whether the node is online and also whether you have administrative rights on the target node. . . .

