Announcement

Collapse
No announcement yet.

Map Printer Drive

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

  • Map Printer Drive

    Hello

    Silly question of the day, We have changed printer in our office I have load the driver on the windows server 2003. I have wrote a batch files to map the printer driver

    Option Explicit
    Dim objNetwork, strUNCPrinter
    strUNCPrinter = "\\dc\Mainoffice"
    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

    Can I force the each user when they log on to run this? I have saved the file ad *.vbs

  • #2
    Re: Map Printer Drive

    Set it as a logon script through Group Policy
    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


    • #3
      Re: Map Printer Drive

      Cheers

      I thought you did in the logon script from aduc Tab? assign logon script

      Comment


      • #4
        Re: Map Printer Drive

        You can do it both ways -- GPOs allow better targetting / control
        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


        • #5
          Re: Map Printer Drive

          It's late so brain is a bit slow, but don't you need to Call the .VBS script from a .BAT file?

          I suppose if you messed around with it a bit you could get the VBS running direct via a GPO (I suppose) but have never tried running one from ADUC Logon Script box.
          1 1 was a racehorse.
          2 2 was 1 2.
          1 1 1 1 race 1 day,
          2 2 1 1 2

          Comment


          • #6
            Re: Map Printer Drive

            Confused Now!

            On testing this I changed one user logon script to test.vbs on the user Proerties in AD.

            I copy the The test.vbs to //domain controller/ NETLOGON directory /test.vbs

            When I logged off then logged back on the Sciprt did not work? So i manually when to

            //domain controller/netlogon/test.vbs then run this which worked? Should The test.vbs file be somewhere else e.i sysvol/dc.local/scripts/????

            Cheers

            Comment

            Working...
            X