Scripting Blog [archived]

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

Hey, Scripting Guy! How Can I Use Data Read From a Text File as Command-Line Parameters For a Batch File?

(image) Hey, Scripting Guy! I'm trying to automate a tedious license server task. To do this, I need to loop through a text file line-by-line, grab out a user name, asset number, and license ID, and then pass those values to a batch file. How can I do all that?-- DM(image) (image) (image) Hey, DM. Before we get started today is Friday, ...

Hey, Scripting Guy! How Can I Use Both AND and OR Operators in a Single WMI Query?

(image) Hey, Scripting Guy! I’ve looked through the entire Script Center but I can’t find an example of what I need to do: find all the .DOC files on drives C and D, but using a single WMI query. In other words, I want to write a WMI query similar to this: Where ( Drive = 'C:' or 'D:' ) and ( Extension = 'doc' ); unfortunately, though, I...

Hey, Scripting Guy! How Can I List the Members of a Domain Group That Belongs to the Local Administrators Group?

(image) Hey, Scripting Guy! I manage over 300 servers in our environment. For each server I need to determine the members of the local Administrators account. It’s easy to get a list of local users and domain users that belong to the Admin account; it’s also easy to get a list of any domain groups that belong to the Administrators ...

Hey, Scripting Guy! How Can I Retrieve the User Name and User Initials From Microsoft PowerPoint?

(image) Hey, Scripting Guy! In PowerPoint user information is stored under the Tools menu. I would like to know if there is a way to extract this data by using a script.-- TV(image) (image) (image) Hey, TV. You know, you might find this hard to believe, but the Scripting Guy who writes this column hardly ever loses anything; in fact, he’...

Hey, Scripting Guy! How Can I Get a List of Active Directory Groups That Have Just 1 Member or Fewer?

(image) Hey, Scripting Guy! We’re trying to straighten out our Active Directory, and in order to do so, I’ve been asked to come up with a list of all the groups that have just 1 member or fewer. How can I write a script that will return this information for me?-- DR (image) (image) (image) Hey, DR. Before we answer your question ...