Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Map printer connection

Reply
Thread Tools Display Modes

Map printer connection

 
 
Steffen Brandsborg
Guest
Posts: n/a

 
      02-22-2010

Hi all,

Im trying to map a network shared printer to a LPT port using a logon script
in group policy.

The script works just fine when i launch the script directly from a logged
in user, but fails when i use group policy.

my script:

Set wshNetwork = WScript.CreateObject("WScript.Network")
Set wshNetwork = CreateObject("WScript.Network")

wshNetwork.AddPrinterConnection "LPT2", "\\SERVER\Printer"


 
Reply With Quote
 
 
 
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      02-22-2010

"Steffen Brandsborg" <no-> wrote in message
news:ulDt%...
> Hi all,
>
> Im trying to map a network shared printer to a LPT port using a logon
> script
> in group policy.
>
> The script works just fine when i launch the script directly from a logged
> in user, but fails when i use group policy.
>
> my script:
>
> Set wshNetwork = WScript.CreateObject("WScript.Network")
> Set wshNetwork = CreateObject("WScript.Network")
>
> wshNetwork.AddPrinterConnection "LPT2", "\\SERVER\Printer"
>


The script looks fine (although you can skip the first "Set wshNetwork"
statement). I suspect the logon script is not running. See #8 in this link
for the method I use to configure logon scripts in Group Policy:

http://www.rlmueller.net/LogonScriptFAQ.htm

In particular, I like to paste the script into the "Show Files" dialog. To
check if your script is running, perhaps add a statement to the script to
map a drive letter to a shared folder (which the user has access to).

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


 
Reply With Quote
 
 
 
 
David H. Lipman
Guest
Posts: n/a

 
      02-23-2010
From: "Steffen Brandsborg" <no->

| Hi all,

| Im trying to map a network shared printer to a LPT port using a logon script
| in group policy.

| The script works just fine when i launch the script directly from a logged
| in user, but fails when i use group policy.

| my script:

| Set wshNetwork = WScript.CreateObject("WScript.Network")
| Set wshNetwork = CreateObject("WScript.Network")

| wshNetwork.AddPrinterConnection "LPT2", "\\SERVER\Printer"



All you need is ONE command line..

net use lpt2: \\server\printer

{ no fancy programming needed }


--
Dave
http://www.claymania.com/removal-trojan-adware.html
Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp


 
Reply With Quote
 
Steffen Brandsborg
Guest
Posts: n/a

 
      03-11-2010
Thanks for the help guys,

I use the net use command. easy stuff

i have rated both replys as useful

"David H. Lipman" <DLipman~nospam~@Verizon.Net> wrote in message
news:...
> From: "Steffen Brandsborg" <no->
>
> | Hi all,
>
> | Im trying to map a network shared printer to a LPT port using a logon
> script
> | in group policy.
>
> | The script works just fine when i launch the script directly from a
> logged
> | in user, but fails when i use group policy.
>
> | my script:
>
> | Set wshNetwork = WScript.CreateObject("WScript.Network")
> | Set wshNetwork = CreateObject("WScript.Network")
>
> | wshNetwork.AddPrinterConnection "LPT2", "\\SERVER\Printer"
>
>
>
> All you need is ONE command line..
>
> net use lpt2: \\server\printer
>
> { no fancy programming needed }
>
>
> --
> Dave
> http://www.claymania.com/removal-trojan-adware.html
> Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
View Full Map for Network Map scottpen Windows Vista Networking 30 02-21-2009 09:12 PM
Re: Shared Drive Letters: to map or not to map? Phillip Windell Server Networking 2 08-22-2008 08:23 PM
can't map to a network drive but can map to others NCS Windows Vista Networking 2 10-05-2007 02:40 PM
Map Printer in Remote Desktop Connection Billy Leung Windows Small Business Server 3 07-25-2005 01:39 AM
"Add" a printer or "map" a printer??? Craig Scripting 1 10-05-2004 08:53 PM