Announcement

Collapse
No announcement yet.

Logon Script Printer

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

  • Logon Script Printer

    Hello

    I bet i'm done something silly!

    Our Printer has broken, I install a New Network Printer I wanted a logon script for our windows server 2003 user to install the printer

    Option Explicit
    Dim objNetwork, strUNCPrinter
    strUNCPrinter = "\\dc\UpRicho"
    Set objNetwork = CreateObject("WScript.Network")
    objNetwork.AddWindowsPrinterConnection strUNCPrinter
    ' Here is where we set the default printer to strUNCPrinter
    objNetwork.SetDefaultPrinter strUNCPrinter
    WScript.Echo "Default Printer is : " & strUNCPrinter
    WScript.Quit

    I name this DefPrinter.vbs

    This work's if you run on the User computer I want this on the netlogon folder

    I went into AD User Properies User profile Logon Script Select DefPrinter.vbs
    I copied the Defprinter.vbs into The \\dc1\netlogon\ Secuirity Authenicated Users Read & execute system user full control

    Then told the user to logon in, The Printer did not change, what bit have i missed?

    Cheers

  • #2
    Re: Logon Script Printer

    So the printer is on dc? or dc1?

    Comment


    • #3
      Re: Logon Script Printer

      Sorry Typeover Mistake Both on DC1

      Comment


      • #4
        Re: Logon Script Printer

        So the string you have in the script is using dc1 and not dc as shown?

        Comment


        • #5
          Re: Logon Script Printer

          Apparently script works when run directly, just not under policy

          @JWC -- have you tried creating a CMD file to call the script -- IIRC syntax ic cscript <filename> and setting that as the logon script?
          Tom Jones
          MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
          PhD, MSc, FIAP, MIITT
          IT Trainer / Consultant
          Ossian Ltd
          Scotland

          ** Remember to give credit where credit is due and leave reputation points where appropriate **

          Comment


          • #6
            Re: Logon Script Printer

            Hello

            Yeap the script work's just not in the AD Profile
            Do you mena re the VBS file as a BAT file?

            Regards

            Comment


            • #7
              Re: Logon Script Printer

              I mean a CMD (or BAT) file that consists of a call to the VBS file:
              http://www.msfn.org/board/topic/1211...-vbs-from-cmd/
              Tom Jones
              MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
              PhD, MSc, FIAP, MIITT
              IT Trainer / Consultant
              Ossian Ltd
              Scotland

              ** Remember to give credit where credit is due and leave reputation points where appropriate **

              Comment


              • #8
                Re: Logon Script Printer

                Cheers for repyling

                I think I got it working

                Set WshNetwork = CreateObject("Wscript.network")
                PrinterPath = "\\DC\MainOfficeSharp"
                PrinterDriver = "PrinterDriver"
                WshNetwork.AddwindowsPrinterConnection Printerpath, Printerdriver
                WshNetwork.SetdefaultPrinter "\\DC\MainOfficeSharp"


                regards

                Comment

                Working...
                X