Aha, to je standalone server bez AD? Script je pro eventlog na DC. Pro standalone je samozrejme kratsi (zmenil jsem event na 4625, tzn. spatne credentials, at vidis vice detailu):
$filterHash = @{LogName = "Security"; Id = 4625; StartTime = (Get-Date).AddDays(-10)}
$lockoutEvents = Get-WinEvent -FilterHashTable $filterHash -ErrorAction SilentlyContinue
# Building output based on advanced properties
$lockoutEvents | Select @{Name = "BadPWUser"; Expression = {$_.Properties[0].Value}}, `
@{Name = "SourceComputer"; Expression = {$_.Properties[1].Value}}, `
@{Name = "DomainController"; Expression = {$_.Properties[4].Value}}, TimeCreated
Co chces sledovat? Pripojeni na RDP, nebo neuspesnou autentizaci? Oboje najdes v logu (eventvwr.exe), konkretne
Microsoft-Windows-RemoteDesktopServices-RdpCoreTS/Operational eventid 131, napr.
The server accepted a new TCP connection from client [fe80::f444:cdcd:f971:ace8%12]:56752
resp. script neco jako
$filterHash = @{LogName = "Microsoft-Windows-RemoteDesktopServices-RdpCoreTS/Operational"; Id = 131; StartTime = (Get-Date).AddDays(-10)}
$lockoutEvents = Get-WinEvent -FilterHashTable $filterHash -ErrorAction SilentlyContinue
# Building output based on advanced properties
$lockoutEvents | Select @{Name = "Transport"; Expression = {$_.Properties[0].Value}}, `
@{Name = "Client"; Expression = {$_.Properties[1].Value}}, `
TimeCreated
Windows-Security - zde hledej eventid 4625, viz vyse
MP