Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Retrieve Information About the Latest Event Added to an Event Log?

Hey, Scripting Guy! How can I retrieve information about the latest event added to an event log?-- HG Hey, HG. You know, it seems like only yesterday that someone was asking us how they could find the oldest event in an event log. And we remember how we told them that - oh, right: it was only yesterday, wasn’t it? Well, then we won’t ...

How Can I Find the Date of the Oldest Event in an Event Log?

Hey, Scripting Guy! How can I find the date of the oldest event in an event log?-- JL Hey, JL. You know, you just had to make a reference to “old” in your question, didn’t you? Just today one of the Scripting Guys received a letter from the American Association of Retired Persons (AARP). Although the letter acknowledged that this ...

How Can I Count the Number of Computers in a Domain?

Hey, Scripting Guy! How can I count the number of computers in a domain?-- TN Hey, TN. Here’s a true story for you. About 5 years ago, when one of the Scripting Guys first started at Microsoft, his group here (which might not be the most technically-savvy group at the company) needed to get a count of all our computers. How did they do ...

How Can I Auto-Delete Specific File Types from the My Pictures Folder?

Hey, Scripting Guy! How can I auto-delete specific file types from the My Pictures folder? If an error occurs with my fax machine, .drg and .txt files get added to My Pictures. I then have to delete these files before the fax machine will work again.-- WW Hey, WW. You know, this was a case where the Scripting Guys almost outsmarted ...

How Can I Get a List of All the Objects that have been Added to Active Directory Since a Specified Date?

Hey, Scripting Guy! How can I get a list of all the objects that have been added to Active Directory since a specified date?-- KR Hey, KR. First of all we’d like to apologize if our answer here is still a little soggy. No doubt you’ve seen cartoons where someone receives a package in the mail, they hear it ticking and - suspecting the ...

Feedback usabilla icon