Public/Receive-AdfsServerTrace.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<#
.SYNOPSIS
Combines and sorts all the AD FS events generated given an activity ID from background jobs
 
.DESCRIPTION
The Receive-AdfsServerTrace them combines and sorts the results of each background job created with Start-AdfsServerTrace.
If the jobs have not completed, the commandlet will wait until completion of all jobs.
At the end, the jobs will be removed
 
.PARAMETER Jobs
Background jobs generated with the Start-AdfsServerTrace cmdlet
 
.EXAMPLE
$jobs = Start-AdfsServerTrace -ActivityId 00000000-0000-0000-9701-0080000000df -ComputerName @("ADFSSRV1","ADFSSRV2")
Get Admin and Audits for activity ID 00000000-0000-0000-9701-0080000000df on Servers ADFSSRV1 and ADFSSRV2
 
On a regular basis, check how many have completed and how many are running
$jobs | Get-Job -IncludeChildJob | Group-Object State
 
At any point, receive the jobs
$results = Receive-AdfsServerTrace -Jobs $jobs
 
.NOTES
The cmdlet sorts the events based on event timestamp first, then the source of the event (Audit, Admin, and Debug), and then the sequencing within the event source the event came from.
#>

Function Receive-AdfsServerTrace
{
    Write-DeprecationNotice
}