Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Map Drives Based on Membership in a Group?

Hey, Scripting Guy! How can I map drives in a logon script based on a security group each user belong to?-- RO Hey, RO. Considering the fact that this question has been asked by approximately 3,755,392 of our readers - oops, there’s another one; make that 3,755,393 of our readers - we decided it might be a good idea for us to answer it. ...

How Can I List the Members of a Group in Alphabetical Order?

Hey, Scripting Guy! I have a script that returns the names of all the users in an Active Directory group. How can I sort those names in alphabetical order?-- JW Hey, JW. Ah, yes, sorting data: the bane of script writers everywhere. Unfortunately, VBScript doesn’t have a built-in sorting mechanism, and neither does ADSI. Consequently, ...

How Can I Add a Domain User to a Local Administrators Group?

Hey, Scripting Guy! How can I add a domain user to the local Administrators group in a computer?-- MB Hey, MB. One reason we started doing this column was because we wanted to know more about what system administrators do (and script) on a regular basis. As it is, sitting here in our luxurious penthouse suites atop the Microsoft campus, we...