+ Post New Thread
Page 4 of 4 FirstFirst 1234
Results 46 to 51 of 51
Windows Server 2000/2003 Thread, Windows 2003 R2 Printer Management in Technical; The lack of default printer options is quite possibly the most brainless bit of design on server software I've come ...
  1. #46
    gshaw's Avatar
    Join Date
    Sep 2007
    Location
    Essex
    Posts
    2,656
    Thank Post
    165
    Thanked 220 Times in 203 Posts
    Rep Power
    67
    The lack of default printer options is quite possibly the most brainless bit of design on server software I've come across - amazing that it's never had a patch or update (seems like the email notifications in the print management console have never worked either???)

    My solution was to use a script that checks the OU of the workstation and uses an if statement to assign the right printers, should the OU not be mentioned it uses else to map a default printer. There's also an add-on I put in to map printers by security group e.g. if you restrict access to a colour printer etc.

    Having moved all the printers onto GPO when we first got R2... then moved the lot back onto scripts again I'll be sticking with my VBS for a while longer

  2. #47

    Join Date
    Dec 2009
    Location
    London
    Posts
    16
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    gshaw, thanks for your reply!
    We used to use a batch script to connect to the local printers but ended up tatooing the printers onto the machines.
    What you mind posting a copy of your vb script? Sounds like it might work quite well for us.

  3. #48
    Chad's Avatar
    Join Date
    May 2007
    Location
    Elgin
    Posts
    74
    Thank Post
    5
    Thanked 20 Times in 19 Posts
    Rep Power
    18
    Quote Originally Posted by joematthews View Post
    What you mind posting a copy of your vb script? Sounds like it might work quite well for us.
    I've written a kix script which maps printers and sets defaults based upon the PC's group membership - it could easily be adapted to use the PC's OU, the PC Name or user's group membership. It reads the groups and printers from a separate .ini file so there's no code tweaking required when you want to make changes/additions. I can post it if you're interested.
    Last edited by Chad; 4th February 2010 at 02:04 PM. Reason: typo

  4. #49

    Join Date
    Dec 2009
    Location
    London
    Posts
    16
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by Chad View Post
    I've written a kix script which maps printers and sets defaults based upon the PC's group membership - it could easily be adapted to use the PC's OU, the PC Name or user's group membership. It reads the groups and printers from a separate .ini file so there's no code tweaking required when you want to make changes/additions. I can post it if you're interested.
    Chad, yes if you could post the script I would really appreciate it!!! Not that advanced with scripting myself as I tend to get bogged down with other jobs!

    Thanks

  5. #50
    gshaw's Avatar
    Join Date
    Sep 2007
    Location
    Essex
    Posts
    2,656
    Thank Post
    165
    Thanked 220 Times in 203 Posts
    Rep Power
    67
    Here's my one with the optional colour printer by security group script at the end...

    Code:
    '*************************************
    '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 "\\yourprintserver\alluserprinter1"
    
    Select Case strComputerOU
    
        Case "OU1"
            objNetwork.AddWindowsPrinterConnection "\\yourprintserver\printer1"
            objNetwork.AddWindowsPrinterConnection "\\yourprintserver\printer2"
            objNetwork.SetDefaultPrinter "\\yourprintserver\grs-printer"
        Case "OU2"
            objNetwork.AddWindowsPrinterConnection "\\yourprintserver\printer3"
            objNetwork.AddWindowsPrinterConnection "\\yourprintserver\printer4"
            objNetwork.SetDefaultPrinter "\\yourprintserver\grs-printer3"
        Case Else
            objNetwork.SetDefaultPrinter "\\yourprintserver\genericprinter"
    	
    End Select
    
    '************************************
    'Map Colour Printer by Security Group
    '************************************
    
    on error resume next
    
    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 "\\yourprintserver\colourprinter"        
    
        End Select
    Next
    If you don't need the security group stuff remove the bottom section, if you want the group checker but not the mesasge remove the printmsg line
    Last edited by gshaw; 4th February 2010 at 02:47 PM.

  6. #51
    Chad's Avatar
    Join Date
    May 2007
    Location
    Elgin
    Posts
    74
    Thank Post
    5
    Thanked 20 Times in 19 Posts
    Rep Power
    18
    Here you go, the code is well commented so you should hopefully be able to follow what's going on if you want a look. I'd recommend using Notepad++ as it colours all the keywords and make it easier to read.

    *** Updated ***
    Now supports PC Group, OU or PC Name matching

    It's set for applying printers based on the group membership of the PC, if you want to change this to OU membership or matches on the name of the PCs then you can change a single line of the script as explained in the comments.

    Hmmm, actually I could tweak the code so that the section names in the .ini file could contain an identifier which determines whether the match should be made on a group, OU or PC Name. This would eliminate the need for any code editing and make the printer assignment very flexible. Do you think that would be a useful feature?

    The readme should hopefully give you enough info on the installation and use.

    Let me know if you need any help.

    Cheers,

    Chad
    Attached Files Attached Files
    Last edited by Chad; 5th February 2010 at 08:47 AM. Reason: Overhauled code to add matching on OUs and PC names as well as groups

SHARE:
+ Post New Thread
Page 4 of 4 FirstFirst 1234

Similar Threads

  1. Network Printer Management Software
    By western in forum Wireless Networks
    Replies: 20
    Last Post: 12th June 2008, 01:52 PM
  2. Pushing printer installs from Windows 2003 R2
    By localzuk in forum Windows
    Replies: 16
    Last Post: 20th February 2007, 02:58 PM
  3. windows 2003 sever r2 printer manager!
    By krisd32 in forum Windows
    Replies: 5
    Last Post: 18th December 2006, 07:40 PM
  4. Quota Management in Windows 2003 R2
    By wesleyw in forum Windows
    Replies: 0
    Last Post: 5th September 2006, 10:06 AM
  5. Windows 2003 Server R2 - No printer ports !!
    By pmassingham in forum Windows
    Replies: 2
    Last Post: 1st September 2006, 03:16 PM

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
  •