+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, Printer Mapping as x in Coding and Web Development; I've got a problem with a standalone laptop, I don't want to add it to the domain as we havent ...
  1. #1

    Join Date
    May 2008
    Posts
    213
    Thank Post
    2
    Thanked 27 Times in 27 Posts
    Rep Power
    17

    Printer Mapping as x

    I've got a problem with a standalone laptop, I don't want to add it to the domain as we havent got anything setup for vanila XP clients (CC3..) but I'd like to be able to map some printers from our main DC.

    I did a quick test script that seems to be working:

    Code:
    Set WshNetwork = CreateObject("WScript.Network")
    
    rem ** This will delete existing printers **
    On Error Resume Next
    Set oPrinters = WshNetwork.EnumPrinterConnections
    For i = 1 to oPrinters.Count - 1 Step 2
    WshNetwork.RemovePrinterConnection oPrinters.Item(i)
    Next
    
    rem ** Adds printers - new line for each printer **
    Set WshNetwork = CreateObject("WScript.Network")
    strPrint1 = "\\fbs-sr-001\F20-LASER"
    strPrint2 = "\\fbs-sr-001\F20-COLOUR"
    WshNetwork.AddWindowsPrinterConnection strPrint1
    WshNetwork.AddWindowsPrinterConnection strPrint2
    
    rem ** Setup default printer **
    WshNetwork.SetDefaultPrinter strPrint1
    #

    This works great however being a standalone laptop the mappings are made as our domain admin account (must have been previously used to map a drive manually or something), this is a pain since all print jobs from this laptop wouldn't show up as the correct user for logging/quota purposes.

    Is there a way to map the printer as a certain AD user or is the only way logging into the domain?

    Sorry for the silly question, just want to know if theres an 'easy' route before sorting out how to get the laptop playing with the domain.

  2. #2

    Join Date
    Mar 2007
    Posts
    1,669
    Thank Post
    72
    Thanked 249 Times in 199 Posts
    Rep Power
    64
    if you get them to conenct to a share it will prompt for username/password, we've found this then allows print jobs to come from the same account as it's authenicated.

  3. #3

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    10,691
    Thank Post
    824
    Thanked 2,570 Times in 2,187 Posts
    Blog Entries
    9
    Rep Power
    731
    You should be able to do this by adding the printer as an lpt mapped printer which allows you to specify a username to connect as, this printer will still show up in windows and so print just as the other method did.

    Code:
    object.AddPrinterConnection(strLocalName, strRemoteName[,bUpdateProfile][,strUser][,strPassword])
    AddPrinterConnection Method
    echo

    Just make sure that you map it to an ltp port that is not in use on the computer as non admin users can't override the local mapping, lpt3 should be fine.

  4. #4

    Join Date
    May 2008
    Posts
    213
    Thank Post
    2
    Thanked 27 Times in 27 Posts
    Rep Power
    17
    thanks, i'll give that a whirl

SHARE:
+ Post New Thread

Similar Threads

  1. Smart Printer and Microsoft Office Printer
    By jamin100 in forum How do you do....it?
    Replies: 1
    Last Post: 26th February 2008, 11:15 PM
  2. Replies: 13
    Last Post: 20th February 2008, 04:29 PM
  3. mapping drives
    By rjsmith in forum *nix
    Replies: 2
    Last Post: 14th November 2007, 05:42 PM
  4. mapping drives
    By chrbb in forum Wireless Networks
    Replies: 3
    Last Post: 3rd November 2007, 03:18 PM
  5. Replies: 6
    Last Post: 23rd June 2007, 08:44 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •