Mundy

IT Knowledge Base

User Tools

Site Tools


Sidebar

Contact me at dan@mundy.co for any feedback or suggestions.


My other sites:

Search all my sites:

report_on_temp_profiles_across_multiple_servers

Report on Temp Profiles Across Multiple Servers

$date=(Get-Date).AddDays(-31)
$events=get-eventlog -logname application -cn RDS01 -after $date | ?{$_.eventid -eq "1511"} | select TimeGenerated, MachineName, UserName
$events+=get-eventlog -logname application -cn RDS02 -after $date | ?{$_.eventid -eq "1511"} | select TimeGenerated, MachineName, UserName
$events+=get-eventlog -logname application -cn RDS03 -after $date | ?{$_.eventid -eq "1511"} | select TimeGenerated, MachineName, UserName
$events | export-csv c:\calibreone\temp-profiles-$((Get-Date).ToString('MM-dd-yyyy')).csv -notypeinformation

To enable proper sorting by time and date, format the time/date column in Excel as Custom: mmm d, yyyy hh:mm am/pm

report_on_temp_profiles_across_multiple_servers.txt · Last modified: 2018/04/09 09:56 (external edit)