Scripting Blog [archived]

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

Hey, Scripting Guy! How Can I Create Users from a CSV File?

(image) Hey, Scripting Guy! In your last article, you showed how to create random passwords for users and how to write that password out to a CSV file. You said if anyone asked that you would show how to use that CSV file and create a user from it. Well, here I am, asking you. Show me the script. I'll send chocolate.- LZ(image) (image) Hi ...

Hey, Scripting Guy! How Can I Remove Group Members Whose User Accounts Reside in a Specific OU?

(image) Hey, Scripting Guy! I have a problem and I haven’t quite figured out how to solve it. I have an Active Directory group, and I’d like to remove some users from that group; in particular, I’d like to remove all the users whose user accounts reside in a specified OU. How do I do that?-- AD (image) (image) (image) Hey...

Hey, Scripting Guy! How Can I Map Drives Based on Membership in an Active Directory Group When the User Belongs to Multiple Groups?

(image) Hey, Scripting Guy! In yesterday’s column you showed a sample script that mapped a drive based on membership in an Active Directory group; along the way, you brought up the possibility of a user belonging to more than one group. “Suppose you have two groups,” you said. “What happens if a user is a member of both groups?” ...

Hey, Scripting Guy! How Can I Map Drives Based on Membership in an Active Directory Group?

(image) Hey, Scripting Guy! I need to map a drive based on a user’s membership in a particular Active Directory group. However, I have a twist as well: I need to map a different drive depending on whether or not the user is a manager. In other words, I need to map a drive based on both group membership and job title. How do I do that?-- SA...

Hey, Scripting Guy! How Can I Get the Name and whenCreated Values for All the Users in Active Directory?

(image) Hey, Scripting Guy! How can I get the Name and whenCreated values for all the users in my Active Directory domain and then write that information to a comma-separated values file?-- MM(image) (image) (image) Hey, MM. Well, assuming all has gone according to plan, by the time most of your read this column the Scripting Guys will be ...