Scripting Blog [archived]

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

Hey, Scripting Guy! How Can I List All the Users in an OU Who Are Not Members of a Specified Group?

(image) Hey, Scripting Guy! How can I get a list of all the users in an OU who are not a member of a specified group?-- TJ (image) (image) (image) Hey, TJ. You know, the Scripting Guys are having so much fun with the 2008 Winter Scripting Games that we just can’t bear to see the excitement come to an end; therefore, we’ve decided...

Hey, Scripting Guy! How Can I Move Files Based on a Portion of the File Name?

(image) Hey, Scripting Guy! I have tens of thousands of files that all have a file name that includes a number bounded by two underscore characters; for example, P_19_L00.jpg. I need to figure out which number is embedded in a file name, then move that file to a folder named after that number. In this case, that means moving P_19_L00.jpg to ...

Hey, Scripting Guy! How Can I Create a GUID Using Windows PowerShell?

(image) Hey, Scripting Guy! I see that it is pretty easy to generate a GUID using Windows Script Host. But how can I do this using Windows PowerShell?-- DL (image) (image) (image) Hey, DL. Before we begin we’d like to announce that the Scripting Guys are looking for 158 volunteers, volunteers to undertake a daring mission. What sort of...

Hey, Scripting Guy! How Can I Check the Value of a Specific Cell in a Bunch of Office Excel Spreadsheets?

(image) Hey, Scripting Guy! How can I create a script that will list all the files in a directory that have a specific value in a specific cell of an Office Excel workbook? And can that be expanded into a find/replace function?-- RDC (image) (image) (image) Hey, RDC. Now that we’re finally beginning to get a bunch of scores posted for ...

Hey, Scripting Guy! How Can I Find a Word in a Document and Change the Background Color of the Paragraph Where That Word Appears?

(image) Hey, Scripting Guy! I have a bunch of reports and log files that are saved as Microsoft Word documents. I’d like to be able to search for a specific word in one of these documents (e.g., the word “Failed”) and then change the background color of any paragraph that the target word appears in. How can I do that?-- XD (...