Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Share All the Local Printers on a Computer?

Hey, Scripting Guy! How can I write a script that will automatically share all the local printers on a computer?-- CD Hey, CD. You know, when we redid the Hey, Scripting Guy! archive we created a new category devoted exclusively to printing. When we started to fill out the archive pages, however, we discovered - much to our surprise - that ...

How Can I Delete an Active Directory Object that Contains Other Objects?

Hey, Scripting Guy! How can I delete an Active Directory object that contains other objects?-- TS Hey, TS. Ah, yes, the dreaded “objects that contain other objects” dilemma. Is there a way to delete an Active Directory object that contains other objects? Let’s see if we can find one. For those of you new to Active Directory scripting...

How Can I Change the User Information in Microsoft Office?

Hey, Scripting Guy! How can I change the user information in Microsoft Office to match the user’s name as stored in Active Directory?-- SM Hey, SM. Back in the days when one of the Scripting Guys worked for a local university, every document in one department of 300+ users appeared to have been created by the same person; that’s because...

How Can I Tell Which Version of the .NET Framework is Installed on a Computer?

Hey, Scripting Guy! How can I tell which version of the .NET Framework is installed on a computer?-- MW Hey, MW. You know, every now and then people say to us, “Wow, you guys write a daily column about system administration scripting; you must be really smart.” We wish. The truth is, we write a daily column about system administration ...

How Can I Monitor Changes to a Registry Key?

Hey, Scripting Guy! Is it possible to use a script to monitor changes to a registry key? I’d like to be notified any time someone makes changes to the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run key.-- SB Hey, SB. And by the way, thanks for wording the question the way you did: it’s actually pretty easy to receive ...