Mundy

IT Knowledge Base

User Tools

Site Tools


report_on_temp_profiles_across_multiple_servers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
report_on_temp_profiles_across_multiple_servers [2017/03/17 13:44]
Dan Mundy created
report_on_temp_profiles_across_multiple_servers [2018/04/09 09:56] (current)
Line 3: Line 3:
 <code powershell>​ <code powershell>​
 $date=(Get-Date).AddDays(-31) $date=(Get-Date).AddDays(-31)
-$events=get-eventlog -logname application -cn IRN-RDS01 -after $date | ?​{$_.eventid -eq "​1511"​} | select TimeGenerated,​ MachineName,​ UserName +$events=get-eventlog -logname application -cn RDS01 -after $date | ?​{$_.eventid -eq "​1511"​} | select TimeGenerated,​ MachineName,​ UserName 
-$events+=get-eventlog -logname application -cn IRN-RDS02 -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 IRN-RDS03 -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 $events | export-csv c:​\calibreone\temp-profiles-$((Get-Date).ToString('​MM-dd-yyyy'​)).csv -notypeinformation
 </​code>​ </​code>​
  
 To enable proper sorting by time and date, format the time/date column in Excel as Custom: mmm d, yyyy hh:mm am/pm 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)