Scripting Blog

A place to learn about PowerShell and share stories of automation

Hey, Scripting Guy! How Can I Use WMI to Add a Printer Connection by Using Windows PowerShell?

Hey, Scripting Guy! I am trying to determine how to use WMI to add a printer connection by using Windows PowerShell. I have found this script, but it uses VBScript and not WMI. This means that it is not very close at all, I am afraid. Do you have a WMI script I can use?- CM Hi CM,Ed looked around, but he did not find anything. Therefore, he ...

Hey, Scripting Guy! How Can I Document Printer Usage on Client Workstations?

Hey, Scripting Guy! I am tasked with the problem of documenting printer use on our client workstations. I must be able to determine whether someone prints directly to a printer, or if they are printing through our print servers. This is important because we have purchased a print monitoring software package that is used to back-charge the ...

Hey, Scripting Guy! Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (05/15/09)

Troubleshooting a Script Written in VBScript  Hey, Scripting Guy! I am writing a Visual Basic script which runs a command-line installation of Exchange 2007. However as soon as the installation starts in a separate DOS window, the script goes to the next line and does not wait for that one to finish. I have looked at How Can I Wait Until ...

Hey, Scripting Guy! How Can I Use Windows PowerShell to Look for and Replace a Word in a Microsoft Word Document?

Hey, Scripting Guy! The week of April 17, 2009, you did a weeklong series of “Hey, Scripting Guy!” articles on regular expressions. I tried to change one of your scripts to open an office Word document that uses Windows PowerShell to look for a particular word. Guess what? It did not work. Instead, it filled my screen with gibberish, the...

Hey, Scripting Guy! How Can I Convert to Windows PowerShell a VBScript Script That Creates a Table in Office Word?

Hey, Scripting Guy! I was looking through the Office Space Archive and came across a nice article that talks about how to create a table in Office Word. The article is interesting, but I am more interested in how to do this by using Windows PowerShell. Will I be able to translate this script to Windows PowerShell? Or do you have one already ...