Определяем пользователей, входивших в систему на этой неделе.

5 views
Skip to first unread message

ajax76

unread,
Mar 16, 2008, 12:43:39 PM3/16/08
to ru-powershell
Get-EventLog -LogName security |
where { $_.EventId -match '528|538' -and
($_.UserName -notmatch 'SYSTEM|NETWORK SERVICE|LOCAL SERVICE') } |
select Username,TimeGenerated |
sort -descend TimeGenerated |
where { ( [datetime]::ToDay-$_.TimeGenerated ).Days -lt 6 }

Код развёрнут исключительно ради удобочитаемости, на самом деле всё
можно сделать в одной строке.
Reply all
Reply to author
Forward
0 new messages