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

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

Comments (3)

  1. Anonymous says:

    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

  2. You probably have a corrupted or missing Mapisp32.exe file. Have you tried the following?

    If you have a missing or damaged file

    Search your c: drive for Mapisp32.exe. When you find it, rename it to Mapisp32.old.

    If you could not find the file, copy the Mapisp32.exe file from your setup compact disc and set your anti-virus program to ignore the file.

    If Mapisp32.exe is in theWindowsSystem folder, uninstall Outlook, including Windows Messaging and reinstall Outlook.

    For more information, you might try