Cyril
28-12-2019, 12:11
Есть такой скрипт для вывода напечатанных заданий:
Set objShell = Wscript.CreateObject("Wscript.Shell")
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colRetrievedEvents = objWMIService.ExecQuery _
("Select TimeGenerated,InsertionStrings from Win32_NTLogEvent where LogFile='System' and SourceName='Print' and EventCode = '10'")
For Each objEvent in colRetrievedEvents
Wscript.Echo objEvent.TimeGenerated & " " & objEvent.InsertionStrings(2) & " " & objEvent.InsertionStrings(3) & " " & objEvent.InsertionStrings(6) & " стр." & objEvent.InsertionStrings(1)
Next
1. Нужно изменить select, чтобы отбор был за текущий месяц
2. Нужно выводить objEvent.TimeGenerated в читаемом виде
3. Нужно вывести данные в csv файл
4. Нужно подсчитать сумму objEvent.InsertionStrings(6) по каждому значению из objEvent.InsertionStrings(3)
Set objShell = Wscript.CreateObject("Wscript.Shell")
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colRetrievedEvents = objWMIService.ExecQuery _
("Select TimeGenerated,InsertionStrings from Win32_NTLogEvent where LogFile='System' and SourceName='Print' and EventCode = '10'")
For Each objEvent in colRetrievedEvents
Wscript.Echo objEvent.TimeGenerated & " " & objEvent.InsertionStrings(2) & " " & objEvent.InsertionStrings(3) & " " & objEvent.InsertionStrings(6) & " стр." & objEvent.InsertionStrings(1)
Next
1. Нужно изменить select, чтобы отбор был за текущий месяц
2. Нужно выводить objEvent.TimeGenerated в читаемом виде
3. Нужно вывести данные в csv файл
4. Нужно подсчитать сумму objEvent.InsertionStrings(6) по каждому значению из objEvent.InsertionStrings(3)