Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Add a Domain Group to the Local Administrators Group?

Hey, Scripting Guy! How can I add a domain group to the local Administrators group?-- SS Hey, SS. You know, people think of the Scripting Guys as striding powerfully through the world of system administration scripting, confident, almost-arrogant in the knowledge that they can meet any challenge thrown at them. We like to think of ourselves...

How Can I Monitor the Activity Level of a Process?

Hey, Scripting Guy! How can I monitor the activity of a process to see if anyone is using it?-- AJ Hey, AJ. You know, this is one time when writing the script is actually the easy part of the answer. Although there are a couple different ways to do this, we opted to periodically check the cumulative amount of processor time used by an ...

How Can I List All the Groups in an OU?

Hey, Scripting Guy! How can I list all the groups in an OU?-- MK Hey, MK. You know, sometimes people ask us a question and then immediately apologize for having asked it, believing that the question is “way too easy for you guys.” In turn, that seems to imply that the Scripting Guys aren’t really guys at all but simply great masses of...

How Can I Copy Column C of One Worksheet to Column A of a Second Worksheet?

Hey, Scripting Guy! How can I copy column C of one worksheet to column A of a second worksheet?-- JP Hey, JP. Well, that’s easy: you just open Excel, highlight column C, press Ctrl+C, put the cursor in column A1 of the second worksheet, and then press Ctrl+V. There you go, and thanks for your question. Oh, right: you wanted to know how to...

How Can I Specify a Window Size for My HTA?

Hey, Scripting Guy! How can I specify a particular window size for my HTA?-- RN Hey, RN. We can’t speak for Dear Abby, Ann Landers or any other daily columnist, but the Scripting Guys are always on the lookout for a question that can be answered using a single line of code. That’s the Holy Grail for daily columnists: one and done. And, ...