Announcement

Collapse
No announcement yet.

help in scripting network printer

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • help in scripting network printer

    Hi,
    we are using a basic script:

    Set WshNetwork = CreateObject("WScript.Network")
    PrinterPath = "\\<servername>\<printer name>"
    PrinterDriver = "HP LaserJet 4050 Series PS"
    WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
    WshNetwork.SetDefaultPrinter "\\<servername>\<printer name>"

    with this script we are not only mapping the printer but also defining it as the default one.

    in the same OU we have 6 people, but one of them is not required to use the printer as default printer.
    since I have the same thing with few more OU's I would like to know is there an "exlude" sysntax for this script, so that I can write for example:

    for user "XXX" do not use as default but only map the printer.

  • #2
    Re: help in scripting network printer

    do this,

    if wshnetwork.username <> "<User Name of User To Exclude>" then
    WshNetwork.SetDefaultPrinter "\\<servername>\<printer name>"
    End If
    MCSE 2000\2003, A+
    00000001-00000011-00000011-00000111

    Comment


    • #3
      Re: help in scripting network printer

      Originally posted by pcking999
      do this,

      if wshnetwork.username <> "<User Name of User To Exclude>" then
      WshNetwork.SetDefaultPrinter "\\<servername>\<printer name>"
      End If

      You are declared as our HERO!

      10x a bunch !!!

      Comment

      Working...
      X