Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Create a Logon Script That Will Open a User’s Mapped Drives?

Hey, Scripting Guy! How can I create a logon script that will open a user’s mapped drives?-- KZ Hey, KZ. You know, a lot of people think we decided to write this column because we wanted yet another way to tell people about scripting. That’s partially true; however, another reason there’s a Hey, Scripting Guy! column is because the ...

How Can I Map Network Drives Based on a Computer’s Site?

Hey, Scripting Guy! How can I parse information in a text file, and then use that information to map network drives based on a computer’s site?-- BH Hey, BH. We’ll be with you in a second - we’re still replaying last night’s baseball game, in which the Kirkland Fire dropped a tough 7-5 decision to a very good team from Bothell. ...

How Can I Determine the Drive Label of a Drive?

Hey, Scripting Guy! Given the drive letter, how can I determine the drive label?-- PM Hey, PM. You know, after sitting around all winter, checking his watch every 15 minutes or so just to verify the date and time, the Scripting Guy who writes this column is pleased to announce that baseball season is officially here. Once more he can enjoy ...

How Can I Determine When a Removable Drive Gets Connected?

Hey, Scripting Guy! How can I determine when a USB flash drive gets connected?-- PS Hey, PS. OK, we admit it: the Scripting Guys are lazy. (Especially on a Friday, which is the day when we have to write our Monday column.) There might be a way to monitor specifically for the insertion of a USB flash drive; however, we couldn’t find one, ...

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

Hey, Scripting Guy! How can I determine which users are using the most disk space on a drive?-- PW 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 amount of disk space charged to...