Skip to content

WMI Ping Script

July 1, 2008

Most of the computer management scripts run against multiple computers, I usually want to have the script do one task if the computer is available for management or another when it’s not. So I put together a very simple function, WMIPing, that takes advantage of the Err object.

The function accepts a single value:

  • strComputer

strComputer

This string variable is usually passed from a calling routine. That routine may be working through a .csv file or it may be pulling this data direct from Active Directory. I attempt a connection to the computer, if it fails I set the online flag to False, otherwise I set it to true.

Advertisements

From → Scripting

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: