Map printer connection

Discussion in 'Scripting' started by Steffen Brandsborg, Feb 22, 2010.

  1. 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"
    Steffen Brandsborg, Feb 22, 2010
    #1
    1. Advertising

  2. "Steffen Brandsborg" <> 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
    --
    Richard Mueller [MVP], Feb 22, 2010
    #2
    1. Advertising

  3. From: "Steffen Brandsborg" <>

    | 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
    David H. Lipman, Feb 23, 2010
    #3
  4. 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" <>
    >
    > | 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
    >
    >
    Steffen Brandsborg, Mar 11, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. scottpen

    View Full Map for Network Map

    scottpen, Feb 27, 2007, in forum: Windows Vista Networking
    Replies:
    30
    Views:
    643
    Bob27519
    Feb 21, 2009
  2. NCS

    can't map to a network drive but can map to others

    NCS, Oct 4, 2007, in forum: Windows Vista Networking
    Replies:
    2
    Views:
    339
  3. Jack-MVP
    Replies:
    0
    Views:
    626
    Jack-MVP
    Mar 9, 2009
  4. Billy Leung

    Map Printer in Remote Desktop Connection

    Billy Leung, Jul 22, 2005, in forum: Windows Small Business Server
    Replies:
    3
    Views:
    319
    Crina Li
    Jul 25, 2005
  5. Craig
    Replies:
    1
    Views:
    158
    Tom Lavedas
    Oct 5, 2004
Loading...

Share This Page