+ Post New Thread
Results 1 to 7 of 7
Scripts Thread, Create Printer on Local Printer Port of Remote Computer in Coding and Web Development; Currently, in our labs, our SysAdmins add a Local Port printer off of a print server, so all users of ...
  1. #1

    Join Date
    Jun 2007
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Create Printer on Local Printer Port of Remote Computer

    Currently, in our labs, our SysAdmins add a Local Port printer off of a print server, so all users of that machine get the same printer automatically. I am trying to write a script that I can run from my office that will do something similar to a remote PC. I'm running into some dead ends, and was hoping the group could point me in a direction that will actually work!

    What is the best way to go about this? I can find lots of examples of scripts that add a printer to the current PC, but not to a remote PC. When I tried using WSHRemote to run a script on a remote PC, I could never get WSHRemote to run, but now just realized that I probably have to open up the firewall ports to allow WSH/WMI to work. If this way works, I have two questions: Anyone know what ports I have to open? If I add the printer and use the SetDefaultPrinter option, will that set it so *all* users of the machine will have the printer?

    I've also just started using the MS-provided printer scripts like prnmgmt.vbs in C:\Windows\System32, but have had problems. It seems like whenever there is ANY kind of error, you get the message "Invalid Parameter".

    I've also played with printui.dll, but didn't like the fact that if I set a global printer with /g, I have to use printui.dll to get rid of it. Also, for some reason, the default printer option, /y, never worked for me.

    Hoping I can get some help from the experts here! Thanks!

  2. #2

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,158
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124

    Re: Create Printer on Local Printer Port of Remote Computer

    "Best way to go about this?" - don't :-)

    use the login script to map printers; that way when you want to map a printer you make one change to the login script and all relevant computers get changed. If you want to change the printer then, again, you just make 1 change - you update the server and next time the user logs on they get the new printer.

    Adding a port to a local machine is fine if you have 2 or computers but it's real hard work if you've got more than a few machines!!

  3. #3
    enjay's Avatar
    Join Date
    Apr 2007
    Location
    Reading, Berkshire, UK
    Posts
    4,497
    Thank Post
    282
    Thanked 196 Times in 167 Posts
    Rep Power
    76

    Re: Create Printer on Local Printer Port of Remote Computer

    Can I ask why you're trying this? There might be another way to achieve the same end result...

  4. #4

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,323
    Thank Post
    903
    Thanked 1,802 Times in 1,551 Posts
    Blog Entries
    12
    Rep Power
    467

    Re: Create Printer on Local Printer Port of Remote Computer

    if you go to the add printer wizard > next > select "local printer connected to this computer" & uncheck the tick box > Create new port - local port > now its asks you to type a port name use the full printer path eg \\server1\printer1 > Install drivers and customise your settings

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,323
    Thank Post
    903
    Thanked 1,802 Times in 1,551 Posts
    Blog Entries
    12
    Rep Power
    467

    Re: Create Printer on Local Printer Port of Remote Computer

    that might not be what your looking for sorry

  6. #6

    Join Date
    Jun 2007
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Create Printer on Local Printer Port of Remote Computer

    Why this method? I thought adding it to the login script would slow down logins. And besides, Microsoft gives us an interface, WSHRemote, that runs a script on a remote computer, so why can't I take a script that adds a printer and sets it to the default, and run it from my office and push it to one or many remote computers? I can't, because even though MS presents it as easy, I've followed all the steps and checklists and it still doesn't work.

    It looks like I'm in the minority, and will do it in a login script. It just frustrates me when I'm given an interface and I can't get it to work like it is supposed to.

  7. #7

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,158
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124

    Re: Create Printer on Local Printer Port of Remote Computer

    It's ages since I've played with the WSHRemote (and I've never tried adding printer ports with it) but it can be made to work - I remember that the problems I had were with security (and this was before XPSP2 which tightened up security even more).

    There's always more than one way to do things - some are good for a small network; others are better in a big network; some will work anywhere! In my opinion, adding ports in this way is only really suitable for small networks :-)

    logon slowdown is an issue - as I've said many times on this web site, you need to measure things to find out what the truth is.

    What I've found about mapping printers in a login script is that the first time a user on a particular computer connects to a remote printer, it can take some time to do (a few seconds). From then on, any other user connecting to the same printer is very quick - the drivers are already installed and very little actually happens so there's no real slowdown.

    Obviously, you know your network a lot better than anyone here and, ultimately, it's up to you to find the best way to manage it - good luck with that!



SHARE:
+ Post New Thread

Similar Threads

  1. Could not connect printer to LPR Port
    By CM786 in forum Windows
    Replies: 6
    Last Post: 13th April 2007, 10:37 AM
  2. Set Default Printer to Machines with Local Printers
    By Heebeejeebee in forum Windows
    Replies: 15
    Last Post: 5th February 2007, 04:00 PM
  3. Viglen Network and remote printer interfaces issue
    By PrimaryTech in forum Wireless Networks
    Replies: 3
    Last Post: 17th October 2006, 01:14 PM
  4. Replies: 21
    Last Post: 11th July 2006, 08:37 PM
  5. Script to create a local user on a XP box.
    By tosca925 in forum Scripts
    Replies: 3
    Last Post: 12th October 2005, 01:04 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
  •