+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
Windows Thread, Adding Printers Via AD in Technical; Any of you guys able to deploy Printers to Workstaions via AD. I use Server 2003 R2 but so far ...
  1. #1

    Join Date
    Jun 2007
    Location
    Barnehurst
    Posts
    157
    Thank Post
    3
    Thanked 2 Times in 2 Posts
    Rep Power
    14

    Adding Printers Via AD

    Any of you guys able to deploy Printers to Workstaions via AD.

    I use Server 2003 R2 but so far have not got it to work.

    How have you set up your policies etc??

  2. #2

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    8,941
    Thank Post
    232
    Thanked 1,510 Times in 1,206 Posts
    Rep Power
    328
    Once you have 2003 R2 installed, you need to enable Printer Management (which from memory) is within Add/Remove Programs > Add/Remove Windows Components

    You can then distribute printers per user or per computer. I generally do things per user and it works great

  3. #3

    Join Date
    Jun 2007
    Location
    Barnehurst
    Posts
    157
    Thank Post
    3
    Thanked 2 Times in 2 Posts
    Rep Power
    14
    Quote Originally Posted by Michael View Post
    Once you have 2003 R2 installed, you need to enable Printer Management (which from memory) is within Add/Remove Programs > Add/Remove Windows Components

    You can then distribute printers per user or per computer. I generally do things per user and it works great

    Yeah I have that done, but im confused on how to implement this.

    Ive created an OU with a group of machine put into it. Do I need to create a GP for that OU just for Printers to be assigned??

    I want it on a 'Per Machine' basis.

  4. #4
    jsnetman's Avatar
    Join Date
    Oct 2007
    Posts
    887
    Thank Post
    23
    Thanked 134 Times in 126 Posts
    Rep Power
    39
    Yes you have to create a policy if you do not have an existing unique policy for that group of computers. The deploy printers is last on the list in the machine portion of the policy.

  5. #5
    dhoward_westexetc's Avatar
    Join Date
    May 2008
    Location
    Exeter, Devon
    Posts
    223
    Thank Post
    46
    Thanked 21 Times in 17 Posts
    Rep Power
    16
    You also need to run the application 'pushprinterconnections.exe' as a machine/user startup script in the same GPO as the deployed printer is contained in, if your clients are Windows 2000, Windows XP or Windows Server 2003.

  6. #6
    GlennT's Avatar
    Join Date
    Sep 2006
    Location
    Zummmerzet!
    Posts
    249
    Thank Post
    19
    Thanked 17 Times in 16 Posts
    Rep Power
    19
    Quote Originally Posted by dhoward_westexetc View Post
    You also need to run the application 'pushprinterconnections.exe' as a machine/user startup script in the same GPO as the deployed printer is contained in, if your clients are Windows 2000, Windows XP or Windows Server 2003.
    Agreed! However, when I tried this with some of the more "senior" PC's, they failed. Have you tried assigning printers via a logon script?

  7. #7
    Heebeejeebee's Avatar
    Join Date
    Nov 2006
    Location
    Intergalactic Cruise
    Posts
    1,036
    Thank Post
    68
    Thanked 74 Times in 58 Posts
    Rep Power
    34
    We never managed to sucessfully get it working every time. Sometimes it works but not others. See this page for more details.

    We reverted to a vbs script in the end which picks up the machine name (or part thereof) and assigns printers based on that. Works everytime.

    HBJB

  8. #8
    gshaw's Avatar
    Join Date
    Sep 2007
    Location
    Essex
    Posts
    2,604
    Thank Post
    154
    Thanked 205 Times in 190 Posts
    Rep Power
    64
    Don't bother with the mapping by AD it's crap... no decent way of setting a default printer which is diabolical and if you've gotta run the client anyway might as well use a logon script

    I've got a very nifty vbs file now that maps the printers by the computer's OU so the right printer "follows" the user as they login to different PCs... job done

  9. #9
    link470's Avatar
    Join Date
    Nov 2007
    Location
    Canada
    Posts
    250
    Thank Post
    85
    Thanked 8 Times in 6 Posts
    Rep Power
    14
    Quote Originally Posted by gshaw View Post
    Don't bother with the mapping by AD it's crap... no decent way of setting a default printer which is diabolical and if you've gotta run the client anyway might as well use a logon script

    I've got a very nifty vbs file now that maps the printers by the computer's OU so the right printer "follows" the user as they login to different PCs... job done

    !!!!!!!1111111oneoneone May I please have a copy of that vbs script? That would save me a LOT of time. I've been looking for a way to do this for ages. Map printers based on location. Much appreciated! Thanks!

  10. #10
    gshaw's Avatar
    Join Date
    Sep 2007
    Location
    Essex
    Posts
    2,604
    Thank Post
    154
    Thanked 205 Times in 190 Posts
    Rep Power
    64
    PM'd this to someone else before so prob easier just to whack it on this thread

    Here's the script, built it from 2-3 different ones I found over time...


    Should be obvious from the script anyway but just to mention that it follows the Computer's OU so if all your machines are just plonked in one place it won't make much difference... but then who doesn't sort them by room

    '*************************************
    'Maps new printers based on current OU
    '*************************************

    dim printmsg

    dim strUserName ' Current user

    Set objNetwork = CreateObject("WScript.Network")
    strUserName = objNetwork.UserName

    Set objSysInfo = CreateObject("ADSystemInfo")
    strName = objSysInfo.ComputerName

    arrComputerName = Split(strName, ",")
    arrOU = Split(arrComputerName(1), "=")
    strComputerOU = arrOU(1)

    '****************************************
    'Map Department Printers from Computer OU
    '****************************************

    objNetwork.AddWindowsPrinterConnection "\\server\printer1"

    Select Case strComputerOU

    Case "001"
    objNetwork.AddWindowsPrinterConnection "\\server\printer2"
    objNetwork.AddWindowsPrinterConnection "\\server\printer3"
    objNetwork.SetDefaultPrinter "\\server\printer2"
    Case "003"
    objNetwork.AddWindowsPrinterConnection "\\server\printer4"
    objNetwork.SetDefaultPrinter "\\server\printer4"
    Case Else
    objNetwork.SetDefaultPrinter "\\server\printer5"

    End Select

    '************************************
    'Map Colour Printer by Security Group
    '************************************

    strUserPath = "LDAP://" & objSysInfo.UserName
    Set objUser = GetObject(strUserPath)

    For Each strGroup in objUser.MemberOf
    strGroupPath = "LDAP://" & strGroup
    Set objGroup = GetObject(strGroupPath)
    strGroupName = objGroup.CN

    Select Case strGroupName

    Case "ColourPrinter"
    printmsg = MsgBox("You now have access to the colour printer ",64,"Printers")
    objNetwork.AddWindowsPrinterConnection "\\server\colourprinter"

    End Select
    Next


    Note the first printer mapping with the line

    objNetwork.AddWindowsPrinterConnection "\\server\printer1"

    That's there in case you have a global printer you always use, saves writing it on each line!

    You can also lose the printmsg line at the end if you don't want the dialog box to pop up, only did that so I could see if the colour printer part was running.

    The end bit also maps a printer by security group, in my case it's a way to restrict colour print access, if not required just remove the last section and also the dim printmsg line at the beginning.

    The script works by the OU the computer is in, so you just need the OU name, no need to give nested group names, full DN etc.

    Another script I use with this as well is one to delete all network printers before mapping any new ones...


    '****************************
    'Deletes old network printers
    '****************************

    On error Resume Next
    Dim cNetCommands, vPrinterName, vPrinterPath
    Set cNetCommands = WScript.CreateObject("WScript.Network")
    Set vPrinterPath = cNetCommands.EnumPrinterConnections
    For Each vPrinterName in vPrinterPath
    cNetCommands.RemovePrinterConnection(vPrinterName)
    Next
    Wscript.Quit


    Hope this helps, let me know how you get on...
    Last edited by gshaw; 28th August 2008 at 12:39 PM.

  11. Thanks to gshaw from:

    link470 (29th August 2008)

  12. #11

    Join Date
    Aug 2008
    Posts
    3
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Another Batch Way

    Get con2prt.exe and put in your logon folder. (http://www.gruppenrichtlinien.de/tools/con2prt.exe)

    con2prt does not need any special rights on the user to connect printers.
    Create a new logon script that you use on a gpo with your users in in this way:

    Code:
    @echo off
    %logonserver%\netlogon\con2prt /f    <<-- this deletes all connected printers (only network printers, no local printers!)
    
    if /i %computername:~0,3%==114 goto h114  <<-- this reads the first 3 letters of the computername and then jumps to the connect line for the room that follows:
    
    goto end
    
    :h114
    %logonserver%\netlogon\con2prt /cd "\\s1\h114" <<-- this connects the printer h114 that is created on a server [called s1 in this example] and sets it to the default printer
    %logonserver%\netlogon\con2prt /c "\\s1\h114c"
    goto end
    
    :end
    You have to simply create a if-case for every room and a :room definition and it will work. Simply and fast.

    Bye,
    bjoern

  13. Thanks to deepsky from:

    link470 (29th August 2008)

  14. #12
    link470's Avatar
    Join Date
    Nov 2007
    Location
    Canada
    Posts
    250
    Thank Post
    85
    Thanked 8 Times in 6 Posts
    Rep Power
    14
    Thanks to both of you deepsky and gshaw for your help! Question for deepsky, in your code you have

    :h114
    %logonserver%\netlogon\con2prt /cd "\\s1\h114" <<-- this connects the printer h114 that is created on a server [called s1 in this example] and sets it to the default printer
    %logonserver%\netlogon\con2prt /c "\\s1\h114c"
    goto end

    was there a difference between /cd as you put in the first line and /c as you put in the second line?

    -----------------------------------

    Another question, if I'm doing this by OU like in gshaw's suggestion, how do I write an OU that's within another OU? Normally I guess I'd just say "Staff" for example? But what if I have an OU called Library for library computers, and theres 5 staff machines in there, and 30 student machines. How would it work? If the OU Domain Root>Staff Computers>Library, and Domain Root>Student Computers>Library, both contain computers in an OU called Library, within seperate other OU's, how would it know the difference if I just entered "Library" between the two different OU's named identically? Or do I show the path of the OU somehow? Thanks!
    Last edited by link470; 29th August 2008 at 01:48 AM.

  15. #13

    Join Date
    Aug 2008
    Posts
    38
    Thank Post
    5
    Thanked 2 Times in 2 Posts
    Rep Power
    12
    I use a very similar vbs script and it works very well. I use it based on a machine name, and what I do is create what I call "zones". Each zone prints to a unique printer. So what I do is use the 5th letter of the name to put in a letter like A or B or C. So I do it like this |School Name| Zone Letter| Room| Computer Number|. An example of this in use at a school named unionpoint, and in zone b would be: unioB252-3.

    The script I uses reads the 5th letter and attaches the printer based off of that.

  16. #14
    azrael78's Avatar
    Join Date
    Sep 2007
    Location
    Devon
    Posts
    383
    Thank Post
    47
    Thanked 37 Times in 33 Posts
    Rep Power
    20
    Quote Originally Posted by link470 View Post
    Thanks to both of you deepsky and gshaw for your help! Question for deepsky, in your code you have

    :h114
    %logonserver%\netlogon\con2prt /cd "\\s1\h114" <<-- this connects the printer h114 that is created on a server [called s1 in this example] and sets it to the default printer
    %logonserver%\netlogon\con2prt /c "\\s1\h114c"
    goto end

    was there a difference between /cd as you put in the first line and /c as you put in the second line?

    -----------------------------------
    At a wild guess I'd say the /cd means - 'connect' + 'set default', so it sets \\s1\h114 as the default printer, whereas the /c is simply 'connect'.

    Az

  17. #15

    Join Date
    Aug 2008
    Posts
    3
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by azrael78 View Post
    At a wild guess I'd say the /cd means - 'connect' + 'set default', so it sets \\s1\h114 as the default printer, whereas the /c is simply 'connect'.

    Az
    Aye, /c = connect ; /cd connect + default printer

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 11
    Last Post: 13th August 2008, 02:35 PM
  2. Adding own column in AD
    By timbo343 in forum Windows
    Replies: 4
    Last Post: 22nd April 2008, 04:57 PM
  3. Adding IP Exclusion`s???
    By Athlona in forum General Chat
    Replies: 4
    Last Post: 18th January 2008, 08:59 AM
  4. Replies: 12
    Last Post: 22nd June 2007, 01:49 PM
  5. Replies: 2
    Last Post: 17th May 2007, 09:54 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
  •