+ Post New Thread
Results 1 to 8 of 8
Windows Thread, printers dropping off pcs in Technical; I have just started a new job as a network manager this week so trying to solve a few probelms. ...
  1. #1
    RichB's Avatar
    Join Date
    Oct 2008
    Location
    A Nice School
    Posts
    400
    Thank Post
    142
    Thanked 51 Times in 38 Posts
    Rep Power
    71

    Thumbs down printers dropping off pcs

    I have just started a new job as a network manager this week so trying to solve a few probelms.

    The network is a little dodgy to say the least they/we've (now) been having a problem for quite some time with printers dissappearing off the students pcs.

    We are using xp sp3, server 2003, there is a print server and the students use this very long scipt in there log on to select the printer, but nothing shows agter log in, this is not every pc just one in two!!!

    Any ideas? Cheers

    infact so long has to be on different posts

    On Error Resume Next

    Dim objShell, objFSO, msg, createfolder, strComputerName, objRegExp
    Dim RoomName, strDrive, strNetShare, strPrinterPath
    dim ppath, printers, wshnetwork

    'Delete All Mapped Printers Before Mapping New Ones

    'Remove all Network printers but not local printers
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    Set Printers = WshNetwork.EnumPrinterConnections

    For i = 0 to Printers.Count - 1 Step 2

    If Left(ucase(Printers.Item(i+1)),2) = "\\" Then
    WSHNetwork.RemovePrinterConnection Printers.Item(i+1)
    End IF
    Next


    set objShell = WScript.CreateObject("WScript.Shell")
    set objFSO = CreateObject("Scripting.FileSystemObject")
    set objNetwork = CreateObject("WScript.Network")
    set objRegExp = New RegExp
    set objPrinters = objNetwork.EnumPrinterConnections

    strComputerName = objNetwork.ComputerName



    'Map room specific printers
    '
    '-----Copy and adapt this section when assigning a printer------
    '
    'If CheckRoom("ROOM-NAME-HERE") Then
    ' MapPrinter("NETWORK-PATH-TO-PRINTER-HERE") 'This line can be replicated multiple times for additional printers
    ' objNetwork.SetDefaultPrinter ("NETWORK PATH TO DEFAULT PRINTER HERE")
    'End If
    '
    '------------------------------------------------------------

    If CheckRoom("ART_B17-01") Then
    MapPrinter("\\PENISTONE.shelley.local\B17_A4")
    MapPrinter("\\ART_B17-03\A3_1290")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\B17_A4")
    End If

    If CheckRoom("ART_B17-02") Then
    MapPrinter("\\PENISTONE.shelley.local\B17_A4")
    MapPrinter("\\ART_B17-03\A3_1290")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\B17_A4")
    End If

    If CheckRoom("ART_B17-04") Then
    MapPrinter("\\PENISTONE.shelley.local\B17_A4")
    MapPrinter("\\ART_B17-03\A3_1290")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\B17_A4")
    End If

    If CheckRoom("ART_B17-TEACHER") Then
    MapPrinter("\\PENISTONE.shelley.local\B17_A4")
    MapPrinter("\\ART_B17-03\A3_1290")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\B17_A4")
    End If

    If CheckRoom("ART_B17-03") Then
    MapPrinter("\\PENISTONE.shelley.local\B17_A4")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\B17_A4")
    End If


    If CheckRoom("ART_B19-") Then
    MapPrinter("\\PENISTONE.shelley.local\B19_A4")
    MapPrinter("\\PENISTONE.shelley.local\B19_A3")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\B19_A4")
    End If

    If CheckRoom("ART_B20-") Then
    MapPrinter("\\PENISTONE.shelley.local\B20_A4")
    MapPrinter("\\PENISTONE.shelley.local\B20_A3")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\B20_A4")
    End If

    If CheckRoom("ART_B20A") Then
    MapPrinter("\\PENISTONE.shelley.local\B20A_A4")
    MapPrinter("\\PENISTONE.shelley.local\B20_A3")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\B20A_A4")
    End If

    If CheckRoom("CAREERS-01") Then
    objNetwork.SetDefaultPrinter ("HP Deskjet F300 series")
    End If

    If CheckRoom("LSU-LAP5") Then
    MapPrinter("\\PENISTONE.shelley.local\SSC_FS4000DN ")
    MapPrinter("\\PENISTONE.shelley.local\SSC_HP2600N" )
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\SSC_FS4000DN")
    End If

    If CheckRoom("LAPTOP17-SSC2") Then
    MapPrinter("\\PENISTONE.shelley.local\SSC_FS4000DN ")
    MapPrinter("\\PENISTONE.shelley.local\SSC_HP2600N" )
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\SSC_FS4000DN")
    End If

    If CheckRoom("LAPTOP16-SSCMEE") Then
    MapPrinter("\\PENISTONE.shelley.local\SSC_FS4000DN ")
    MapPrinter("\\PENISTONE.shelley.local\SSC_HP2600N" )
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\SSC_FS4000DN")
    End If

    If CheckRoom("LAPTOP11-SSCTEA") Then
    MapPrinter("\\PENISTONE.shelley.local\SSC_FS4000DN ")
    MapPrinter("\\PENISTONE.shelley.local\SSC_HP2600N" )
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\SSC_FS4000DN")
    End If

    If CheckRoom("FYEAR-01") Then
    objNetwork.SetDefaultPrinter ("FYEAR_OLDHP")
    End If

    If CheckRoom("FYEAR-02") Then
    MapPrinter("\\FYEAR-01\FYEAR_OLDHP")
    objNetwork.SetDefaultPrinter ("\\FYEAR-01\FYEAR_OLDHP")
    End If

    If CheckRoom("D36") Then
    MapPrinter("\\PENISTONE.shelley.local\D36_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\D36_FS4000DN")
    End If

    If CheckRoom("HUM_") Then
    MapPrinter("\\PENISTONE.shelley.local\H77_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\H77_FS4000DN")
    End If

    If CheckRoom("B13") Then
    MapPrinter("\\PENISTONE.shelley.local\FT_A4Col")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\FT_A4Col")
    End If

    If CheckRoom("B14") Then
    MapPrinter("\\PENISTONE.shelley.local\FT_A4Col")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\FT_A4Col")
    End If

    If CheckRoom("B15") Then
    MapPrinter("\\PENISTONE.shelley.local\FT_A4Col")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\FT_A4Col")
    End If

    If CheckRoom("DT_") Then
    MapPrinter("\\PENISTONE.shelley.local\DT_EPSON_C11 00")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\DT_EPSON_C1100")
    End If

    If CheckRoom("DT_B8-04") Then
    MapPrinter("DT_HP_A3")
    MapPrinter("\\PENISTONE.shelley.local\DT_EPSON_C11 00")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\DT_EPSON_C1100")
    End If

    If CheckRoom("LIBRARY") Then
    MapPrinter("\\PENISTONE.shelley.local\LIB_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\LIB_FS4000DN")
    End If


    If CheckRoom("C29") Then
    MapPrinter("\\PENISTONE.shelley.local\C29_7300DX")
    objNetwork.SetDefaultPrinter ("PDFCreator")
    End If

    If CheckRoom("G66") Then
    MapPrinter("\\PENISTONE.shelley.local\G65_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\G65_FS4000DN")
    End If

    If CheckRoom("ENG") Then
    MapPrinter("\\PENISTONE.shelley.local\G69_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\G69_FS4000DN")
    End If

    If CheckRoom("E43") Then
    MapPrinter("\\PENISTONE.shelley.local\E43_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\E43_FS4000DN")
    End If

  2. #2
    RichB's Avatar
    Join Date
    Oct 2008
    Location
    A Nice School
    Posts
    400
    Thank Post
    142
    Thanked 51 Times in 38 Posts
    Rep Power
    71
    If CheckRoom("MATHS") Then
    MapPrinter("\\PENISTONE.shelley.local\MRA_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\MRA_FS4000DN")
    End If

    If CheckRoom("MUSIC") Then
    MapPrinter("\\PENISTONE.shelley.local\music_kyo")
    ' MapPrinter("\\PENISTONE.shelley.local\D36_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\music_kyo")
    End If

    ' I have put this here in case ICT Support Staff need to logon as a student
    If CheckRoom("ICTTEAM") Then
    MapPrinter("\\PENISTONE.shelley.local\ict_hpl7780" )
    MapPrinter("\\PENISTONE.shelley.local\ict_hp5550")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\ict_hpl7780")
    End If

    If CheckRoom("CLICKVIEW") Then
    MapPrinter("\\PENISTONE.shelley.local\ict_hpl7780" )
    MapPrinter("\\PENISTONE.shelley.local\ict_hp5550")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\ict_hpl7780")
    End If

    If CheckRoom("C31") Then
    MapPrinter("\\PENISTONE.shelley.local\C31_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\C31_FS4000DN")
    End If

    If CheckRoom("C30") Then
    MapPrinter("\\PENISTONE.shelley.local\C30_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\C30_FS4000DN")
    End If

    If CheckRoom("C25") Then
    MapPrinter("\\PENISTONE.shelley.local\C25_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\C25_FS4000DN")
    End If

    If CheckRoom("B22") Then
    MapPrinter("\\PENISTONE.shelley.local\B22_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\B22_FS4000DN")
    End If

    If CheckRoom("PE_ICT") Then
    MapPrinter("\\PENISTONE.shelley.local\PE_FS4000DN" )
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\PE_FS4000DN")
    End If

    If CheckRoom("PE_P1") Then
    MapPrinter("\\PENISTONE.shelley.local\PE_FS4000DN" )
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\PE_FS4000DN")
    End If

    If CheckRoom("MFL") Then
    MapPrinter("\\PENISTONE.shelley.local\MFL_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\MFL_FS4000DN")
    End If

    If CheckRoom("H77") Then
    MapPrinter("\\PENISTONE.shelley.local\H77_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\H77_FS4000DN")
    End If

    If CheckRoom("H72") Then
    MapPrinter("\\PENISTONE.shelley.local\H77_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\H77_FS4000DN")
    End If

    If CheckRoom("G67") Then
    MapPrinter("\\PENISTONE.shelley.local\G67_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\G67_FS4000DN")
    End If

    If CheckRoom("G68") Then
    MapPrinter("\\PENISTONE.shelley.local\G67_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\G67_FS4000DN")
    End If

    If CheckRoom("G65") Then
    MapPrinter("\\PENISTONE.shelley.local\G65_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\G65_FS4000DN")
    End If

    If CheckRoom("SCI_A") Then
    MapPrinter("\\PENISTONE.shelley.local\SCI_RES")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\SCI_RES")
    End If

    If CheckRoom("SCI_E") Then
    MapPrinter("\\PENISTONE.shelley.local\MLAB_FS2000" )
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\MLAB_FS2000")
    End If

    If CheckRoom("SFC") Then
    MapPrinter("\\PENISTONE.shelley.local\SFC_HP_P2015 ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\SFC_HP_P2015")
    End If

    If CheckRoom("STUDENTSUPP") Then
    MapPrinter("\\PENISTONE.shelley.local\SSC_FS4000DN ")
    MapPrinter("\\PENISTONE.shelley.local\SSC_HP2600N" )
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\SSC_FS4000DN")
    End If

    If CheckRoom("STAFFQRM") Then
    MapPrinter("\\PENISTONE.shelley.local\SQR_FS4000DN ")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\SQR_FS4000DN")
    End If

    If CheckRoom("MOBILE-") Then
    MapPrinter("\\PENISTONE.shelley.local\MOBILES")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\MOBILES")
    End If

    Function MapPrinter(strPrinterPath)
    PrinterPath = strPrinterPath
    objNetwork.AddWindowsPrinterConnection PrinterPath
    End Function


    Function CheckRoom(RoomName)
    CheckRoom = False
    objRegExp.IgnoreCase = True
    objRegExp.Global = True
    objRegExp.Pattern = RoomName
    CheckRoom = objRegExp.Test(strComputerName)
    End Function

    set objShell = NOTHING
    set objFSO = NOTHING
    set objNetwork = NOTHING

  3. #3
    danrhodes's Avatar
    Join Date
    Sep 2008
    Location
    Wath Upon Dearne
    Posts
    1,513
    Thank Post
    157
    Thanked 181 Times in 150 Posts
    Rep Power
    68
    Good but too bl**dy complicated for me! Just keep it simple and it will work fine. You can run this remotely and it will add a permenant connection to the specified printer for who ever loggs on, wether pupil or staff.

    RUNDLL32 PRINTUI.DLL,PrintUIEntry /c \\MachineName1 /ga /n "\\ServerName\PrinterShare"
    RUNDLL32 PRINTUI.DLL,PrintUIEntry /c \\MachineName2 /ga /n "\\ServerName\PrinterShare"
    RUNDLL32 PRINTUI.DLL,PrintUIEntry /c \\MachineName3 /ga /n "\\ServerName\PrinterShare"
    RUNDLL32 PRINTUI.DLL,PrintUIEntry /c \\MachineName4 /ga /n "\\ServerName\PrinterShare"

    Or you can run it locally.

    RUNDLL32 PRINTUI.DLL,PrintUIEntry /ga /n "\\ServerName\PrinterShare"

    D

  4. Thanks to danrhodes from:

    RichB (7th May 2010)

  5. #4
    RichB's Avatar
    Join Date
    Oct 2008
    Location
    A Nice School
    Posts
    400
    Thank Post
    142
    Thanked 51 Times in 38 Posts
    Rep Power
    71
    Im taking it I would put the script in a .bat file then place it in the start up?

  6. #5
    RichB's Avatar
    Join Date
    Oct 2008
    Location
    A Nice School
    Posts
    400
    Thank Post
    142
    Thanked 51 Times in 38 Posts
    Rep Power
    71
    Anyone else have any ideas? I've got about 50% of the printers down.....

  7. #6

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,239
    Thank Post
    882
    Thanked 2,742 Times in 2,316 Posts
    Blog Entries
    11
    Rep Power
    784
    Does the problem persist on the samcomputers for every logon or is it just once in a while that this happens?

    You could simplify the above script and still keep all of its functionallity by combining some of the room checks as their printer allocation is the same i.e.
    Code:
    If ( CheckRoom("ART_B17-02") OR CheckRoom("ART_B17-02") OR CheckRoom("ART_B17-02") OR CheckRoom("ART_B17-TEACHER") ) Then
    MapPrinter("\\PENISTONE.shelley.local\B17_A4")
    MapPrinter("\\ART_B17-03\A3_1290")
    objNetwork.SetDefaultPrinter ("\\PENISTONE.shelley.local\B17_A4")
    End If
    This would shrink it substantally from a reading and debugging point of view.

    Secondly I would be tempted to comment out:
    Code:
    On Error Resume Next
    to
    Code:
    'On Error Resume Next
    which would allow any error messages that happened to show up so that you could look to them for clues.

    Just to check your print server is running a Windows Server OS rather than XP as XP has a nasty 10 connection limit.

  8. Thanks to SYNACK from:

    RichB (10th May 2010)

  9. #7
    RichB's Avatar
    Join Date
    Oct 2008
    Location
    A Nice School
    Posts
    400
    Thank Post
    142
    Thanked 51 Times in 38 Posts
    Rep Power
    71
    It is a windows server OS, very new to this vbs scripting stuff was using shared printers before and for some reason it will not allow it on this network. Just looking for a work around until half term when I can rip everything apart a simple script to manually change and add printers per room.

    Will try the above Thanks

  10. #8
    danrhodes's Avatar
    Join Date
    Sep 2008
    Location
    Wath Upon Dearne
    Posts
    1,513
    Thank Post
    157
    Thanked 181 Times in 150 Posts
    Rep Power
    68
    Quote Originally Posted by RichB View Post
    Im taking it I would put the script in a .bat file then place it in the start up?
    No you do not need to put the script into the startup script it only needs to be ran once. I usually use Excel to concatenate the names of the machines into a script, copy into notepad and then run it with the machines turned on. Once the script has ran the printers will be permenantly added to the machine until they are removed using the same script but with the /gd switch in place of the /ga switch.

    D

SHARE:
+ Post New Thread

Similar Threads

  1. Hyper-V console dropping when using a VM
    By FN-GM in forum Windows Server 2008 R2
    Replies: 6
    Last Post: 2nd December 2009, 11:19 AM
  2. Audio Dropping
    By TechMonkey in forum Windows
    Replies: 6
    Last Post: 30th January 2009, 05:09 PM
  3. IP addresses dropping out.
    By steve_nfi in forum Wireless Networks
    Replies: 1
    Last Post: 11th June 2008, 09:22 AM
  4. PC's dropping off the domain?
    By TechSupp in forum Network and Classroom Management
    Replies: 7
    Last Post: 21st February 2008, 11:46 AM
  5. PCs dropping off the network
    By SpuffMonkey in forum Windows
    Replies: 11
    Last Post: 2nd March 2006, 10:10 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
  •