답변:
정말 멋진 질문입니다. 여기 내 솔루션이 있습니다 (Keltari의 답변에서 부분적으로 영감을 얻음).
요구 사항
snapshot_login_failure.cmd (ffmpeg.exe가있는 일부 폴더에 배치)
@echo off
:: Get date and time independent of regional settings. Source: http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-us
for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set datetime=%ldt:~0,4%_%ldt:~4,2%_%ldt:~6,2%_%ldt:~8,2%_%ldt:~10,2%_%ldt:~12,2%
:: Capture snapshot through DirectShow using FFmpeg and save to disk. Change name of video adapter and save path.
ffmpeg.exe -f dshow -i video="USB 2.0 UVC HD Webcam" -vframes 1 E:\snapshot_%datetime%.jpg
snapshot_login_failure.xml (Windows 스케줄러 태스크로 가져 오기)
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2013-07-06T23:32:34.0732602</Date>
<Author>Zoe\Zero3</Author>
</RegistrationInfo>
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
<Subscription><QueryList><Query Id="0" Path="Security"><Select Path="Security">*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=4625]]</Select></Query></QueryList></Subscription>
</EventTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-19</UserId>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
<UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>E:\snapshot_login_failure.cmd</Command>
<WorkingDirectory>E:\</WorkingDirectory>
</Exec>
</Actions>
</Task>
노트
낡은 실을 되살려 서 미안하지만, 앞으로 이것을 넘어 질 사람을위한 도움으로 이것을 게시하고 있습니다.
Zero3의 프로세스는 대부분 그에게 많은 도움이되었습니다! 그러나 실패한 로그인 시도의 로깅을 활성화 한 다음 로그에서 이벤트 ID를 마우스 오른쪽 버튼으로 클릭하고 XML을 통해 작업을 가져 오는 대신 "이 이벤트에 작업 첨부"를 선택했습니다. 작업을 만들려면 관리자 암호를 입력해야했기 때문에 권한을 사용하십시오.
나를 이상하게 생각한 또 다른 것은 트리거 된 작업이 .cmd 파일을 프로그램 / 스크립트로 인식하지 않았다는 것입니다. 이 문제를 해결하기 위해 아래 코드와 동일한 디렉토리에 run.bat라는 간단한 .bat 파일을 만들었고 대신 작업에서 배치 파일을 시작하여 .cmd를 실행했습니다.
그것이 작동하게하는 홉 스카치 방법의 종류이지만,이 스레드 덕분에 내 성공에 매우 만족하고 있으며이 과정에 대한 비디오 자습서를 만들고 싶습니다 :)
많은 감사합니다!
참고 : Windows 10 Pro x64를 실행 중입니다.
run.bat 코드 :
Start "" "C:\<filepath to .cmd>"
예, Windows MSGINA에 익숙한 경우 이론적으로 랩톱에서 카메라를 시작하고 사진을 찍어 사용자 지정 폴더에 저장하는 사용자 지정 로그인 이벤트를 만들 수 있습니다.
참조 : http://technet.microsoft.com/en-gb/library/bb742447.aspx