Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Monitor for the Creation of Different Processes?

Hey, Scripting Guy! How can I use one script to monitor for the creation of four or five different processes?-- BC Hey, BC. You know, it’s too bad you didn’t ask how you could monitor four or five TV shows at the same time. Had you done that we would have had the perfect answer for you: get yourself a teenaged son. Although the ...

How Can I Determine When a Removable Drive Gets Connected?

Hey, Scripting Guy! How can I determine when a USB flash drive gets connected?-- PS Hey, PS. OK, we admit it: the Scripting Guys are lazy. (Especially on a Friday, which is the day when we have to write our Monday column.) There might be a way to monitor specifically for the insertion of a USB flash drive; however, we couldn’t find one, ...

How Can I Log the Start Time and the End Time of the Screensaver?

Hey, Scripting Guy! How can I log the start time and the end time of the screensaver?-- JS Hey, JS. You know, one of the Scripting Guys (hey, who said “It must be Greg”?) is old enough to remember the days when screensavers first came out. Back then a script like this would have been meaningless: after all, once a screensaver started ...

How Can I Receive Notification Any Time Something is Printed to a Particular Printer?

Hey, Scripting Guy! How can I receive notification any time something is printed to a particular printer?-- IL Hey, IL. You know, one of the Scripting Guys once had a summer job in an organization where the only decent printer in the entire building was kept in the administrative assistant’s office. We can attest, from painful experience...

How Can I Monitor the Event Logs for the Occurrence of a Specific Event?

Hey, Scripting Guy! How can I monitor the event logs for the occurrence of a specific event?-- JP Hey, JP. Why, you use an event log monitoring script, of course. (Yes, it’s hard to believe, but they really do pay us to come up with brilliant answers like that.) OK, maybe we should be a little more specific: you use an event log ...