Scripting Blog [archived]

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

How Can I Delete All the Users in an Active Directory Group?

(image) Hey, Scripting Guy! How can I delete all the users in an Active Directory group?-- AA(image) (image) (image) Hey, AA. You know, that’s something we Scripting Guys never thought about: a script that could eliminate all the users in a particular group. The only problem we have with that is: where do we start? For example, maybe we ...

How Can I Convert a Global Security Group to a Universal Security Group?

(image) Hey, Scripting Guy! How can I convert a global security group to a universal security group?-- BB(image) (image) (image) Hey, BB. We have to tell you the truth, we were pretty excited when we first read your email. Convert a global security group to a universal security group? That sounded like a mad scientist sort of thing, and we...

How Can I Remove a Group from the Local Administrators Group?

(image) Hey, Scripting Guy! How can I remove a group from the local Administrators group?-- SB(image) (image) (image) Hey, SB. One of the Scripting Guys has very vague memories of an old TV show called Branded, in which the hero (played by Chuck Connors) was accused of cowardice and then dishonorably discharged from the US Cavalry. About ...

How Can I Add a User to a Group if That User Belongs to Two Other Groups?

(image) Hey, Scripting Guy! How can I check to see if a user is in both group A and group B and, if so, add that user to Group C?-- DH(image) (image) (image) Hey, DH. Good heavens, how are we supposed to know that?!? Sheesh. Sorry; we just always wanted to say that. Now that we have that out of our system, here’s a sample script that ...