Open-AudIT
https://www.open-audit.org/phpBB3/

OAv1 - Printers help
https://www.open-audit.org/phpBB3/viewtopic.php?f=10&t=5934
Page 1 of 1

Author:  omega4471 [ Sat Sep 01, 2012 4:33 am ]
Post subject:  OAv1 - Printers help

Script Audit.vbs work perfectly. Show me all i need. In my network i' distribute printers with gpp for user. Every user see printers published by GPP es: \\printerserver\xerox 5775. The script audit show only local printer and network printer. how i can do to modify the audit.vbs to show me \\printerserver\xerox 5775 ? I' ve a script vbs that list all the printers how i want, this script list printers and create a file text .This is the code:
----------------------------------------------------------------------------------------------------------
Const ForAppending = 8
Const ForReading = 1

Dim WshNetwork, objPrinter, intDrive, intNetLetter

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.UserName
arrUserName = Split(UserName, "\", -1, 1)
varUserName = 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
-----------------------------------------------------------------------------------
Please Someone can help me?

Thanks
Frank

Author:  jpa [ Sat Sep 01, 2012 6:08 am ]
Post subject:  Re: OAv1 - Printers help

OpenAudit doesn't audit per-user data which is what you're asking for. There is no place in the current database schema to store this info and display would require even more editing. Since OAv1 is end-of-life and OAv2 also doesn't audit per-user data you're out of luck.

Author:  omega4471 [ Mon Sep 03, 2012 7:31 pm ]
Post subject:  Re: OAv1 - Printers help

Sin. If I wanted to insert this script, as well as create a table in the database, I need to change only audit.vbs or are there other files for editing?
Thank you, hello
Frank

Author:  Mark [ Wed Sep 05, 2012 9:07 am ]
Post subject:  Re: OAv1 - Printers help

Off the top of my head you would need to:
    alter audit.vbs.
    create a table in the DB.
    alter the PHP file that processes the submitted audit.
    create new sections (in PHP) to display the attributes in the webpages.

Page 1 of 1 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/