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)

Published 07 November 08 02:24 by shawnt

Comments

# How to Map a Printer with Powershell 1.0 | MS Tech News said on November 7, 2008 3:54 AM:

PingBack from http://mstechnews.info/2008/11/how-to-map-a-printer-with-powershell-10/

# Ghedra Dunn said on March 13, 2009 4:51 PM:

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

# shawnt said on March 23, 2009 12:04 AM:

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 the\Windows\System folder, uninstall Outlook, including Windows Messaging and reinstall Outlook.

For more information, you might try http://support.microsoft.com/kb/216796.

Anonymous comments are disabled

About shawnt

Shawn has been a Technology Specialist with Microsoft for the past six years, during which time he has presented to thousands IT Professionals, Partners, and Resellers. In his current position as TechNet Presenter, Shawn delivers briefings throughout the central United States on the full range of business products from Microsoft, with a focus on security-related technologies. The TechNet program is instrumental in providing IT professionals with information on evaluation, deployment, management, and ongoing operation of Microsoft technologies. You will also see Shawn delivering product launches, live webcasts and hosting online chats through the TechNet chat program which he manages for the TechNet team. Shawn has also been quoted in local newspapers and appeared on several television shows across the U.S.
Page view tracker