Scripting Blog [archived]

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

Can I Get a List of All My User Accounts?

(image) Hey, Scripting Guy! Is there any way to get a list of all the user accounts in Active Directory?-- CB, Fremont, CA(image) (image) (image) Hey, CB. By far the quickest and easiest way to do this is to search Active Directory for all your user accounts. Here’s a sample script that searches the fabrikam.com domain; to search your own ...

How Can I Call the Dir Command?

(image) Hey, Scripting Guy! I’m trying to do something that seems pretty simple: call the dir command from a script. It doesn’t seem to work, though. How come?-- CR, Mexico City, Mexico(image) (image) (image) Hey, CR. It appears from your mail that you’re trying to do a simple thing like this: However, instead of getting a list of ...

How Can I Determine if a User is a Local Administrator?

(image) Hey, Scripting Guy! Some of the things we do in our logon scripts require the user to be a local administrator. How can the script tell if the user is a local admin or not?-- GM, Denver, CO Hey, GM. The best way to do that is to check the membership of the local Administrator’s group and see if the user is in there. To do that, ...