Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Change the User and Computer Account Description Attributes Each Time a User Logs On?

Hey, Scripting Guy! How can I change the user and computer account Description attributes each time a user logs on? I’d like the Description to indicate who logged on, and when.-- GG Hey, GG. This is actually a pretty good idea. One question we get asked all the time is this: “How can I get a list of all my computers and who’s logged ...

How Can I Purge All the Print Jobs on a Windows 2000 Print Server?

Hey, Scripting Guy! How can I purge all the print jobs on a Windows 2000 print server?-- KC Hey, KC. This is one of those questions we hate, not because we don’t have an answer for it - we do - but because we have to temporarily abandon one of the core tenets of the Scripting Guy Way of Life. That tenet - just a second while we blow the ...

How Can I Tell if an Excel Workbook is Open and, If It Isn’t, Open It?

Hey, Scripting Guy! How can I tell if a specific Excel workbook is open and, if it isn’t, open it?-- RK Hey, RK. Every now and then we see a question and think, “We should answer this one; it’s so easy it won’t take more than a few minutes to finish the column and then we can all take a nice long lunch.” At some point you’d ...

How Can I Add All the Users from an Existing Active Directory Group to a New Group?

Hey, Scripting Guy! How can I add all the users from an existing Active Directory group to a new group?-- TG Hey, TG. So you have a group (we’ll call it Group A) and you want to create an exact replica of that group (we’ll call it Group B). If we were talking about Text File A and Text File B this would be an easy task: all you’d have...

How Can I Configure a Computer to Use a Dynamically-assigned DNS Server?

Hey, Scripting Guy! How can I configure a computer to use a dynamically-assigned DNS Server?-- JB Hey, JB. Ah, this question brings back memories. A couple years ago the Scripting Guys were faced with this same problem, and discovered the answer entirely by accident; in fact, if Greg was able to type a line of code without making a mistake ...

Feedback usabilla icon