Created
June 19, 2014 12:09
-
-
Save ochoto/1cec5db23668708fdd98 to your computer and use it in GitHub Desktop.
Trabajo con log de eventos y sesiones remotas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$maquinas = (1..10).ForEach{ "CURSOPS" + "{0:D2}" -f $_ } | |
$hace24h = (get-date).AddHours(-24) | |
Get-EventLog -LogName System -After $hace24h -EntryType Error,Warning -ComputerName $maquinas|select *|Out-GridView | |
$mexc = "CURSOPS02","CURSOPS03" | |
$sess = New-PSSession -ComputerName ($maquinas.Where{$mexc -notcontains $_}) | |
$sess.ForEach{ Invoke-Command -Session $_ -ScriptBlock { dir c:\ } } |sort PSComputerName | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment