Avatar of bbayachek
bbayachek
 asked on

group policy default deploying printers by computer settings

I know how to deploy printers via group policies via computer or user settings. It seems like I cannot deploy a shared printer via computer settings and cannot set the printer as the default printer like I can do with user settings.

I have labrooms that need 4 printers installed with one set as the default. I do not want to do it by a user setting.  

I have windows server 2008 r2 and windows 7 as the client.

Thank you
Printers and ScannersWindows Server 2008Active Directory

Avatar of undefined
Last Comment
bbayachek

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
kevinhsieh

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
serialband

You should now be able to set the user group policy under each lab room OU to force a particular printer to be default in that room.
http://blogs.technet.com/b/grouppolicy/archive/2009/06/24/gp-preferences-set-a-default-printer.aspx


If that doesn't work, you could try setting group policy VBscripts in the OU.  I don't have the code anymore, but, long ago, I set 2 VBscripts to do that in group policy for Windows 2000 Server.

The first script was set on the computer GPO and just basically set an environment variable for the room name.  You'll have to load the script onto the server.  Is was very simple, something along the lines of this:
Dim file_path As String 
    ' Set an environment variable.
    SetEnvironmentVariable "LabRoom", "ROOM1"
End Sub

Open in new window


The 2nd script was set on the user account GPO and read the environment variable and added the printer for the room as the default printer.  If the user already had the printer in their profile it becomes the default.  I don't have a Windows machine handy to test, but you would use GetEnvironmentVariable and then use code example from the following site with a case statement to set it.
http://www.vbforums.com/showthread.php?777897-RESOLVED-How-to-Set-Windows-Default-Printer&s=7cf26a4f4562c464832eec1d6acd4ba9

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        ComboBox1.Items.Clear()
        For Each printer As String In Printing.PrinterSettings.InstalledPrinters
            ComboBox1.Items.Add(printer)
        Next printer

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        If Me.ComboBox1.SelectedItem IsNot Nothing Then
            'set the printer name
            Me.PrintDocument1.PrinterSettings.PrinterName = ComboBox1.SelectedItem
            'and print it
            Me.PrintDocument1.Print()

        End If
    End Sub

    Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

        Using br As New SolidBrush(Color.Black)
            e.Graphics.DrawString("printed", Me.Font, br, New Point(10, 10))
        End Using

    End Sub

Open in new window

kevinhsieh

@serialband,  user settings in GPO only apply to user objects in AD. You can't apply them to a computer OU and have anything happen unless the user is in the OU also,  or group policy loopback processing is enabled. If you applied to the user's OU, then they would always get those settings,  which OP probably doesn't want as this is only for the computer lab.
bbayachek

ASKER
We have issues with login time with loop back. Loop back causes many issues.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck