Announcement

Collapse
No announcement yet.

Printers report ??

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

  • Printers report ??

    Hi

    i need to export from the print server all the details i can from the printers
    printer name , IP , location ....

    any VB or application will be good

    i have found this vb , but it fails on line 30 char 1

    please assist

    http://community.spiceworks.com/scri...t-printers-vbs

  • #2
    Re: Printers report ??

    Hi

    is it so hard to find ?


    i thought its much easier

    thanks

    Comment


    • #3
      Re: Printers report ??

      Wow!
      No reply in 1 hour 17 minutes, on a Sunday
      Lousy quality of service these days . There goes my bonus this month

      With nearly 4 years membership you SHOULD know how the board works -- you will get an answer IF someone has one and WHEN they have the free time to post it.

      If you really DO need support on this timescale, raise an incident with Microsoft PSS. Have your credit card ready.

      Oh, just a tiny hint as to the OS on your server would possibly help, or shall I just assume it is NT3.51?
      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


      • #4
        Re: Printers report ??

        Hi

        this wasnt from critisize
        just wandering

        my OS is server 2003

        10x

        Comment


        • #5
          Re: Printers report ??

          Is this for purposes of documentation (if you have too many printers to do this manually, then it seems you're leaving the documenting of your setup a little late ) or for backup/migration?

          If it's for backup or migration, then would Microsoft Print Migrator or the Printer Migration Wizard meet your requirements? Amazing what you can find with 30 seconds of Googling.
          Gareth Howells

          BSc (Hons), MBCS, MCP, MCDST, ICCE

          Any advice is given in good faith and without warranty.

          Please give reputation points if somebody has helped you.

          "For by now I could have stretched out my hand and struck you and your people with a plague that would have wiped you off the Earth." (Exodus 9:15) - I could kill you with my thumb.

          "Everything that lives and moves will be food for you." (Genesis 9:3) - For every animal you don't eat, I'm going to eat three.

          Comment


          • #6
            Re: Printers report ??

            OK, tried it and got multiple errors.
            This does work, though:
            Code:
            '=========================================================================='
            ' Title: List Printers.vbs' 
            ' Date: 02/23/2010' 
            ' Author: Bradley Buskey' 
            ' Version: 1.00' 
            ' Updated: 02/23/2010' 
            ' Purpose: List all printers attached to a workstation' 
            'Modified T Jones 20/6/10
            '=========================================================================='
            '=========================================================================='
            ' Date 03/29/2010
            ' updated: Chris Daws
            ' to include mapped network printers
            '==========================================================================
            Const ForAppending = 8 
            Const ForReading = 1 
            
            Dim WshNetwork, objPrinter, intDrive, intNetLetter, UserName
            
            strComputer = inputbox("Please enter the computer name or IP address.","Computer Name",".") 
            
            Set WshNetwork = CreateObject("WScript.Network") 
            Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
            Set colInstalledPrinters = objWMIService.ExecQuery("Select * from Win32_Printer") 
            Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48) 
            Set WshShell = WScript.CreateObject("WScript.Shell") 
            Set objFSO = CreateObject("Scripting.FileSystemObject") 
            
            For Each objItem in colItems 
            UserName = objItem.Name' wasUserName
            
            'arrUserName = Split(UserName, "\", -1, 1) 
            varUserName = UserName'arrUserName(1) 
            Next 
            
            filOutput = varUserName & ".txt" 
            
            If objFSO.FileExists(filOutput) Then 
            objFSO.DeleteFile(filOutput) 
            End If 
            
            Set objOutputFile = objFSO.OpenTextFile (filOutput, ForAppending, True) 
            For Each objPrinter in colInstalledPrinters 
            strTest = Left(objPrinter.Name, 2) 
            objOutputFile.WriteLine(objPrinter.Name) 
            Next 
            'objOutputFile.Close
            
            
            'added
            Set objPrinter = WshNetwork.EnumPrinterConnections
            'Set objOutputFile = objFSO.OpenTextFile (filOutput, ForAppending, True) 
            If objPrinter.Count = 0 Then
            WScript.Echo "No Printers Mapped "
            else
            For intDrive = 0 To (objPrinter.Count -1) Step 2
            intNetLetter = IntNetLetter +1
            printer = "UNC Path " & objPrinter.Item(intDrive) & " = " & objPrinter.Item(intDrive +1) & " Printer : " & intDrive
            objOutputFile.WriteLine(printer)
            Next
            end if
            objOutputFile.Close
            'added
            
             
            
            varOpen = MsgBox("Do you want to view the printers?",36,"View File?") 
            If varOpen = vbYes Then 
            varCommand = "notepad " & filOutput 
            WshShell.Run varCommand,1,False 
            End If 
            
            Wscript.Sleep 1500 
            MsgBox "Printer mappings have been stored in '" & filOutput & "'.", 64, "Script Complete" 
            Wscript.Quit
            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


            • #7
              Re: Printers report ??

              Originally posted by Ossian View Post
              Lousy quality of service these days . There goes my bonus this month
              I thought you lost your bonus last month when you didn't reply to a thread all night long

              Anyways, for 2003 and prior os, you could also use Print migrator 3.1.
              There are a few things worth mentioning though, it is no longer supported by MS, it has a few restrictions but in general it works fine.
              Caesar's cipher - 3

              ZKHQ BRX HYHQWXDOOB GHFLSKHU WKLV BRX ZLOO UHDOLVH LW ZDV D ZDVWH RI WLPH!

              SFX JNRS FC U6 MNGR

              Comment


              • #8
                Re: Printers report ??

                11112131313132

                the script worked 50%

                only printer name no ip

                error on line
                75
                char 1

                Comment


                • #9
                  Re: Printers report ??

                  What does 11112131313132 mean???

                  That error is the last line of the script. Delete the line or ignore the error.
                  ** Remember to give credit where credit is due and leave reputation points where appropriate **

                  Comment


                  • #10
                    Re: Printers report ??

                    it should bring me also the ip of the printer , right ?

                    the number are keyboard problem

                    Comment


                    • #11
                      Re: Printers report ??

                      I dont think it is designed to list the IP -- it asks for a name or IP to find the computer to run on, but doesnt list an IP as part of the output
                      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

                      Working...
                      X