Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Hey, Scripting Guy! How Can I Get a List of Active Directory Groups That Have Just 1 Member or Fewer?

(image) Hey, Scripting Guy! We’re trying to straighten out our Active Directory, and in order to do so, I’ve been asked to come up with a list of all the groups that have just 1 member or fewer. How can I write a script that will return this information for me?-- DR (image) (image) (image) Hey, DR. Before we answer your question ...

Hey, Scripting Guy! How Can I Use Windows PowerShell to Add a Domain User to a Local Group?

(image) Hey, Scripting Guy! I recently came across your article where you showed people how to use VBScript to add a domain user to a local group. How can I do that same task using Windows PowerShell?-- KE(image) (image) (image) Hey, KE. Before we begin we thought we should mention that the Scripting Guy who writes this column has a new ...

Hey, Scripting Guy! How Can I List All the Users in an OU Who Are Not Members of a Specified Group?

(image) Hey, Scripting Guy! How can I get a list of all the users in an OU who are not a member of a specified group?-- TJ (image) (image) (image) Hey, TJ. You know, the Scripting Guys are having so much fun with the 2008 Winter Scripting Games that we just can’t bear to see the excitement come to an end; therefore, we’ve decided...

Hey, Scripting Guy! How Can I Copy the Membership of a Local Group to a New Local Group?

 (image) Hey, Scripting Guy! I need to “clone” a local group; in other words, I want to create a new group that contains the same members as the original group. However, I can’t find any sort of copy command that would let me do this. How can I copy the membership of a local group to a new local group?-- SO(image) (image) (image...