Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

How Can I Be Notified Any Time a Service Goes Down?

(image) Hey, Scripting Guy! How can I be notified any time a service goes down?-- RN(image) (image) (image) Hey, RN. As usual, there are a couple different ways you can do this, but perhaps the simplest approach is to create a script that monitors WMI events. We don’t have time to do a detailed explanation of WMI events in this column, but...

Can I Change the Command Window Title When Running a Script?

(image) Hey, Scripting Guy! When I run a batch file, I can use the Title command to change the caption of the command window. Can I change the caption of the command window from within a script?-- AA, Yokohama, Japan(image) (image) (image) Hey, AA. Well, yes, as long as you’re willing to open up a new command window. If you are, then you ...

Why am I Getting an Error when Trying to Determine an IP Address?

(image) Hey, Scripting Guy! I’m trying to determine the IP address on a computer, but I keep getting a Type Mismatch error. Do you know why? -- AQ, Jacksonville, FL(image) (image) (image) Hey, AQ. As a matter of fact, we do know why you’re getting a Type Mismatch error, and it’s a common problem when working with the WMI class ...

How Can I Determine Which Groups a User Belongs To?

(image) Hey, Scripting Guy! In my logon script, how can I find out which Active Directory groups a user belongs to? -- JB, Montpelier, VT(image) (image) (image) Hey, JB. This is pretty easy to do in a logon script: So what’s going on here? Well, we begin by using the ADSystemInfo object to determine the distinguished name of the logged-on ...