Scripting Blog

A place to learn about PowerShell and share stories of automation

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

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 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 to extend the Games for a ...

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

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 the ...

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

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 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 mission? We are planning to ...

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

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 Hey, RDC. Now that we’re finally beginning to get a bunch of scores posted for the 2008 Winter Scripting Games ...

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

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 Hey, XD...

Feedback usabilla icon