Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Tue Mar 19, 2024 1:12 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: OAv1 - Printers help
PostPosted: Sat Sep 01, 2012 4:33 am 
Offline
Helper

Joined: Wed Aug 08, 2012 1:49 am
Posts: 70
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


Top
 Profile  
Reply with quote  
 Post subject: Re: OAv1 - Printers help
PostPosted: Sat Sep 01, 2012 6:08 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: OAv1 - Printers help
PostPosted: Mon Sep 03, 2012 7:31 pm 
Offline
Helper

Joined: Wed Aug 08, 2012 1:49 am
Posts: 70
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


Top
 Profile  
Reply with quote  
 Post subject: Re: OAv1 - Printers help
PostPosted: Wed Sep 05, 2012 9:07 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
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.

_________________
Support and Development hours available from [url=https://opmantek.com]Opmantek[/url].
Please consider a purchase to help make Open-AudIT better for everyone.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group