Size: a a a

2021 July 12

RH

Roman Holubenko in Powershell Rus
Properties           : {System.Diagnostics.Eventing.Reader.EventProperty, System.Diagnostics.Eventing.Reader.EventProperty, Syste
                      m.Diagnostics.Eventing.Reader.EventProperty, System.Diagnostics.Eventing.Reader.EventProperty...}

Message              : Отключена задача, выполняемая по расписанию.
                     
                      Субъект:
                        ИД безопасности:    S-1-5-21-1962552246-1002953773-2913600411-4393
                        Имя учетной записи:    sa-super-user
                        Домен учетной записи:    firma
                        ИД входа:    0x552CDBD
                     
                      Сведения о задаче:
                        Имя задачи:     \BGinfo-servers
                        Содержание задачи:     <?xml version="1.0" encoding="UTF-16"?>
                      <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
                        <RegistrationInfo>
                          <Author>firma\da-andronov</Author>
                          <Description>From gpo BGinfo-servers, at logon, after 30 sec</Description>
                          <URI>\BGinfo-servers</URI>
                        </RegistrationInfo>
                        <Principals>
                          <Principal id="Author">
                            <UserId>S-1-5-21-1962552246-1002953773-2913600411-4393</UserId>
                            <LogonType>InteractiveToken</LogonType>
                          </Principal>
                        </Principals>
                        <Settings>
                          <AllowHardTerminate>false</AllowHardTerminate>
                          <DeleteExpiredTaskAfter>P365D</DeleteExpiredTaskAfter>
                          <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
                          <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
                          <Enabled>false</Enabled>
                          <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
                          <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
                          <IdleSettings>
                            <Duration>PT5M</Duration>
                            <WaitTimeout>PT1H</WaitTimeout>
                            <StopOnIdleEnd>false</StopOnIdleEnd>
                            <RestartOnIdle>false</RestartOnIdle>
                          </IdleSettings>
                        </Settings>
                        <Triggers>
                          <LogonTrigger>
                            <StartBoundary>2020-12-01T16:01:59</StartBoundary>
                            <EndBoundary>2051-02-04T16:01:59</EndBoundary>
                            <Delay>PT30S</Delay>
                          </LogonTrigger>
                        </Triggers>
                        <Actions Context="Author">
                          <Exec>
                            <Command>C:\Scripts\Bginfo64.exe</Command>
                            <Arguments>C:\Scripts\srvsample.bgi  /timer:0 /nolicprompt /silent</Arguments>
                            <WorkingDirectory>C:\Scripts</WorkingDirectory>
                          </Exec>
                        </Actions>
                      </Task>
                       
Id                   : 4701
Version              : 0
Qualifiers           :
Level                : 0
Task                 : 12804
Opcode               : 0
Keywords             : -9214364837600034816
RecordId             : 1045534807
ProviderName         : Microsoft-Windows-Security-Auditing
ProviderId           : 54849625-5478-4994-a5ba-3e3b0328c30d
LogName              : Security
ProcessId            : 712
ThreadId             : 792
MachineName          : KYV-VS-F01.firma.ua
UserId               :
TimeCreated          : 12.07.2021 13:57:18
ActivityId           : 4165698e-75e5-0000-a369-6541e575d701
RelatedActivityId    :
ContainerLog         : security
MatchedQueryIds      : {}
источник

RH

Roman Holubenko in Powershell Rus
Bookmark             : System.Diagnostics.Eventing.Reader.EventBookmark
LevelDisplayName     : Сведения
OpcodeDisplayName    : Сведения
TaskDisplayName      : Другие события доступа к объекту
KeywordsDisplayNames : {Аудит успеха}
Properties           : {System.Diagnostics.Eventing.Reader.EventProperty, System.Diagnostics.Eventing.Reader.EventProperty, Syste
                      m.Diagnostics.Eventing.Reader.EventProperty, System.Diagnostics.Eventing.Reader.EventProperty...}

Message              : Включена задача, выполняемая по расписанию.
                     
                      Субъект:
                        ИД безопасности:    S-1-5-21-1962552246-1002953773-2913600411-4393
                        Имя учетной записи:    sa-super-user
                        Домен учетной записи:    firma
                        ИД входа:    0x552CDBD
                     
                      Сведения о задаче:
                        Имя задачи:     \BGinfo-servers
                        Содержание задачи:     <?xml version="1.0" encoding="UTF-16"?>
                      <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
                        <RegistrationInfo>
                          <Author>firma\da-andronov</Author>
                          <Description>From gpo BGinfo-servers, at logon, after 30 sec</Description>
                          <URI>\BGinfo-servers</URI>
                        </RegistrationInfo>
                        <Principals>
                          <Principal id="Author">
                            <UserId>S-1-5-21-1962552246-1002953773-2913600411-4393</UserId>
                            <LogonType>InteractiveToken</LogonType>
                          </Principal>
                        </Principals>
                        <Settings>
                          <AllowHardTerminate>false</AllowHardTerminate>
                          <DeleteExpiredTaskAfter>P365D</DeleteExpiredTaskAfter>
                          <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
                          <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
                          <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
                          <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
                          <IdleSettings>
                            <Duration>PT5M</Duration>
                            <WaitTimeout>PT1H</WaitTimeout>
                            <StopOnIdleEnd>false</StopOnIdleEnd>
                            <RestartOnIdle>false</RestartOnIdle>
                          </IdleSettings>
                        </Settings>
                        <Triggers>
                          <LogonTrigger>
                            <StartBoundary>2020-12-01T16:01:59</StartBoundary>
                            <EndBoundary>2051-02-04T16:01:59</EndBoundary>
                            <Delay>PT30S</Delay>
                          </LogonTrigger>
                        </Triggers>
                        <Actions Context="Author">
                          <Exec>
                            <Command>C:\Scripts\Bginfo64.exe</Command>
                            <Arguments>C:\Scripts\srvsample.bgi  /timer:0 /nolicprompt /silent</Arguments>
                            <WorkingDirectory>C:\Scripts</WorkingDirectory>
                          </Exec>
                        </Actions>
                      </Task>
                       
Id                   : 4700
Version              : 0
Qualifiers           :
Level                : 0
Task                 : 12804
Opcode               : 0
Keywords             : -9214364837600034816
RecordId             : 1045532747
ProviderName         : Microsoft-Windows-Security-Auditing
ProviderId           : 54849625-5478-4994-a5ba-3e3b0328c30d
LogName              : Security
ProcessId            : 712
ThreadId             : 576
MachineName          : KYV-VS-F01.firma.ua
UserId               :
TimeCreated          : 12.07.2021 13:44:50
источник

RH

Roman Holubenko in Powershell Rus
ActivityId           : 4165698e-75e5-0000-a369-6541e575d701
RelatedActivityId    :
ContainerLog         : security
MatchedQueryIds      : {}
Bookmark             : System.Diagnostics.Eventing.Reader.EventBookmark
LevelDisplayName     : Сведения
OpcodeDisplayName    : Сведения
TaskDisplayName      : Другие события доступа к объекту
KeywordsDisplayNames : {Аудит успеха}
Properties           : {System.Diagnostics.Eventing.Reader.EventProperty, System.Diagnostics.Eventing.Reader.EventProperty, Syste
                      m.Diagnostics.Eventing.Reader.EventProperty, System.Diagnostics.Eventing.Reader.EventProperty...}

Message              : Отключена задача, выполняемая по расписанию.
                     
                      Субъект:
                        ИД безопасности:    S-1-5-21-1962552246-1002953773-2913600411-4393
                        Имя учетной записи:    sa-super-user
                        Домен учетной записи:    firma
                        ИД входа:    0x552CDBD
                     
                      Сведения о задаче:
                        Имя задачи:     \BGinfo-servers
                        Содержание задачи:     <?xml version="1.0" encoding="UTF-16"?>
                      <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
                        <RegistrationInfo>
                          <Author>firma\da-andronov</Author>
                          <Description>From gpo BGinfo-servers, at logon, after 30 sec</Description>
                          <URI>\BGinfo-servers</URI>
                        </RegistrationInfo>
                        <Principals>
                          <Principal id="Author">
                            <UserId>S-1-5-21-1962552246-1002953773-2913600411-4393</UserId>
                            <LogonType>InteractiveToken</LogonType>
                          </Principal>
                        </Principals>
                        <Settings>
                          <AllowHardTerminate>false</AllowHardTerminate>
                          <DeleteExpiredTaskAfter>P365D</DeleteExpiredTaskAfter>
                          <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
                          <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
                          <Enabled>false</Enabled>
                          <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
                          <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
                          <IdleSettings>
                            <Duration>PT5M</Duration>
                            <WaitTimeout>PT1H</WaitTimeout>
                            <StopOnIdleEnd>false</StopOnIdleEnd>
                            <RestartOnIdle>false</RestartOnIdle>
                          </IdleSettings>
                        </Settings>
                        <Triggers>
                          <LogonTrigger>
                            <StartBoundary>2020-12-01T16:01:59</StartBoundary>
                            <EndBoundary>2051-02-04T16:01:59</EndBoundary>
                            <Delay>PT30S</Delay>
                          </LogonTrigger>
                        </Triggers>
                        <Actions Context="Author">
                          <Exec>
                            <Command>C:\Scripts\Bginfo64.exe</Command>
                            <Arguments>C:\Scripts\srvsample.bgi  /timer:0 /nolicprompt /silent</Arguments>
                            <WorkingDirectory>C:\Scripts</WorkingDirectory>
                          </Exec>
                        </Actions>
                      </Task>
                       
Id                   : 4701
Version              : 0
Qualifiers           :
Level                : 0
Task                 : 12804
Opcode               : 0
Keywords             : -9214364837600034816
RecordId             : 1045532746
ProviderName         : Microsoft-Windows-Security-Auditing
ProviderId           : 54849625-5478-4994-a5ba-3e3b0328c30d
источник

RH

Roman Holubenko in Powershell Rus
LogName              : Security
ProcessId            : 712
ThreadId             : 576
MachineName          : KYV-VS-F01.firma.ua
UserId               :
TimeCreated          : 12.07.2021 13:44:48
ActivityId           : 4165698e-75e5-0000-a369-6541e575d701
RelatedActivityId    :
ContainerLog         : security
MatchedQueryIds      : {}
Bookmark             : System.Diagnostics.Eventing.Reader.EventBookmark
LevelDisplayName     : Сведения
OpcodeDisplayName    : Сведения
TaskDisplayName      : Другие события доступа к объекту
KeywordsDisplayNames : {Аудит успеха}
Properties           : {System.Diagnostics.Eventing.Reader.EventProperty, System.Diagnostics.Eventing.Reader.EventProperty, Syste
                      m.Diagnostics.Eventing.Reader.EventProperty, System.Diagnostics.Eventing.Reader.EventProperty...}
источник

RH

Roman Holubenko in Powershell Rus
why?
источник

VB

Vector BCO in Powershell Rus
я там написал why
источник

RH

Roman Holubenko in Powershell Rus
2 format-list/format-object - командлеты для вывода в консоль которые не должны ничего передавать на пайп
почему?
источник

VB

Vector BCO in Powershell Rus
ибо это командлеты для вывода в консоль ;)
источник

VB

Vector BCO in Powershell Rus
на велосипеде можно выпрыгнуть с самолета, но лучше вместо двуколесного всеж взять парашют
источник

RH

Roman Holubenko in Powershell Rus
)))
понял
источник

VB

Vector BCO in Powershell Rus
ща 5 мин гляну ивенты
источник

VB

Vector BCO in Powershell Rus
на телефоне не удобно
источник

VB

Vector BCO in Powershell Rus
$ignore =   "(\\Microsoft\\Windows)|(User_Feed_Synchronization)"
$date = ((Get-Date).AddMinutes(-60))
$eventids = @(4698, 4699, 4700, 4701, 4702)
$events = Get-WinEvent -FilterHashtable @{logname='security';id=$eventidS;StartTime=$date} | where {$_.message -match $ignore}
if ($Events){ # Or [string]::isnullorempty($events) # бо хз нужно кричать если найдено или не найдено что-то
  Write-Host "ALARM!!! AHTUNG!!! JOBABOBA, Task was removed\modified!!!1"
}
источник

VB

Vector BCO in Powershell Rus
если хочешь искать в любом месте ивента сделай tak
$events = Get-WinEvent -FilterHashtable @{logname='security';id=$eventidS;StartTime=$date} |  out-file | where {$_.message -match $ignore}
источник

RH

Roman Holubenko in Powershell Rus
-nomatch
источник

RH

Roman Holubenko in Powershell Rus
?
источник

VB

Vector BCO in Powershell Rus
пробуй
я не люблю notmatch бо результат с массивами не всегда очевиден ;)
источник

VG

Vasily Gusev in Powershell Rus
эм, с match такой же =) не очевиден, но я думаю ты знаешь разницу =)
источник

VB

Vector BCO in Powershell Rus
метч я всегда могу на глаз оценить, с нотметч временами попадаю на грабли, поэтому и не люблю
источник

VG

Vasily Gusev in Powershell Rus
наверное... я граблей не помню, но тоже вроде -notmatch редко использую...
источник