Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Lock a Workstation After Five Minutes of Inactivity?

Hey, Scripting Guy! How can I lock a workstation after five minutes of inactivity, something recommended to us by our auditors?-- NM Hey, NM. To tell you the truth, we don’t know. Locking a computer remotely can be a bit of a problem; for more information on that, take a look at one of our columns from a year ago. On top of that, you face...

How Can I Retrieve a List of the System DSNs on a Computer?

Hey, Scripting Guy! How can I retrieve a list of the System DSNs on a computer?-- RT Hey, RT. You know, there’s an old Hollywood superstition that suggests that famous movie stars always die in threes: if a famous star dies today, then according to legend two more famous stars are doomed to die in the next week as well. We don’t know if...

How Can I Monitor Changes to a Registry Key?

Hey, Scripting Guy! Is it possible to use a script to monitor changes to a registry key? I’d like to be notified any time someone makes changes to the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run key.-- SB Hey, SB. And by the way, thanks for wording the question the way you did: it’s actually pretty easy to receive ...

How Can I Get a List of the ODBC Drivers that are Installed on a Computer?

Hey, Scripting Guy! How can I get a list of the ODBC drivers that are installed on a computer?-- VV Hey, VV. This is one of those questions that end up driving us crazy. That’s because it: a) seems so simple and, b) appears as though there are a number of ways to get this information. For example, on our Windows XP computer we have no ...

How Can I List All the User Profiles on a Computer?

Hey, Scripting Guy! How can I list all the user profiles on a computer?-- GN Hey, GN. You want to know a secret? We hate questions about user profiles. It’s not that we have anything against user profiles. The problem is that user profiles represent an important part of a system administrator’s duties, and because of that everyone ...