Question

In Exchange Management Shell, you can write a query to display administrator activities.

Search-AdminAuditLog -Startdate ((get-date).AddDays(-5)) -EndDate (get-date) | where{$_.caller -ne "NT AUTHORITY\SYSTEM (MSExchangeHMWorker)"} |select Caller, Rundate, ObjectModified, CmdLetName, @{n="Parameters"; e={$e=$null;$_.CmdLetParameters|%{$e += ( " -" + $_.name.tostring() + " '" + $_.value + "'")};$e}} | ft -autosize

Most of the commands make sense but can anyone explain the @... part in English? Specifically this part:

@{n="Parameters"; e={$e=$null; $_.CmdLetParameters | %{$e += ( " -" + $_.name.tostring() + " '" + $_.value + "'")};$e}}

Was it helpful?

Solution

That's called a "Calculated property". It's a way to add a property in your selected object with the name specified by n= and having the value resulting from expression e=.

http://technet.microsoft.com/en-us/library/ff730948.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top