Scripting Blog [archived]

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

How Can I List All the Users in an NT 4.0 Domain?

(image) Hey, Scripting Guy! How can I list all the users in an NT 4.0 domain, along with their description and logon script path?-- HH(image) (image) (image) Hey, HH. Ah, yes NT 4.0. Windows NT 4.0 reminds us of dandelions: it doesn’t matter whether you like dandelions or not, there’s simply no way to get rid of them. The same is true ...

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 ...

How Can I Get a List of All the Users in an OU and Its Sub-OUs?

(image) Hey, Scripting Guy! How can I get a list of all the users in an OU and its sub-OUs?-- MN(image) (image) (image) Hey, MN. Thanks to either faulty wiring or a neighbor’s fireworks (the investigation was inconclusive), one of the Scripting Guys had the delightful experience of watching his garage burn down this summer. Because the ...

How Can I Build an Array from a Column of Data in Excel?

(image) Hey, Scripting Guy! How can I build an array from a column of data in Excel?-- AH(image) (image) (image) Hey, AH. Obviously none of the Scripting Guys has any need to go on a diet (perish the thought!), but we do know that one time-honored dieting strategy is the theory of tiny bites: instead of gulping down your food in a few huge...

How Can I Determine Which Users are Using the Most Disk Space on a Drive?

(image) Hey, Scripting Guy! How can I determine which users are using the most disk space on a drive?-- PW(image) (image) (image) Hey, PW. Interesting question. In theory, you could probably do this by retrieving a collection of all the files on a drive, checking the owner, determining the file size, and then keeping a running tally of the...