How to Map a Printer with Powershell 1.0

Well, I just finished presenting three shows in three cities in just two days in the great state of Ohio. The people here are amazingly smart and friendly, and they had many, great questions and comments. One of the questions came from the DANPA "loadfest" event in Dayton last night: "How do you map printers using Powershell 1.0?"

Well, I promised a post, and here it is - I did a bit of research and finally dug this helpful post from Guy Thomas on the computerperformance website. Please do not use the script below without first testing thoroughly in a non-production environment, and neither I nor Microsoft assumes any responsibility for any problems resulting from its use.

To Add or 'Map' a Network Printer

# PowerShell for Mapping a Printer
# Author: Guy Thomas
# Version 1.2 June 2008 tested on PowerShell v 1.0

$PrinterPath = "\\Server\PrintShare"
$net = new-Object -com WScript.Network
$net.AddWindowsPrinterConnection($PrinterPath)

For more information as well as common troubleshooting issues, please consult the original post. (See Example 4)

Comments

  • Anonymous
    January 01, 2003
    When I try to forward an email I get the error code of Map 1.0 [000004c7]  and says MAPI Spooler could not be started. What do I need to do to get this corrected? Please help. Thanks Ghedra Dunn

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    PingBack from http://mstechnews.info/2008/11/how-to-map-a-printer-with-powershell-10/