Last active
June 16, 2017 01:58
-
-
Save kevinblumenfeld/7077bc822bf9976d704f9139ba65eb0f to your computer and use it in GitHub Desktop.
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
function Get-LAMfaStats { | |
<# | |
.Synopsis | |
Short description | |
.DESCRIPTION | |
Long description | |
.EXAMPLE | |
Example of how to use this cmdlet | |
.EXAMPLE | |
Another example of how to use this cmdlet | |
#> | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory = $true, | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true)] | |
[string[]] $userprincipalname | |
) | |
Begin { | |
$resultarray = @() | |
} | |
Process { | |
$logProps = Export-MailboxDiagnosticLogs $_.userprincipalname -ExtendedProperties | |
$xmlprops = [xml]($logProps.MailboxLog) | |
$stats = $xmlprops.Properties.MailboxTable.Property | ? {$_.Name -like "ELC*"} | |
$statHash = @{} | |
for ($i = 0; $i -lt $stats.count; $i++) { | |
$statHash[$stats[$i].name] = [$stats[$i].value] | |
} | |
$resultarray += [PSCustomObject]$statHash | |
} | |
End { | |
$resultarray | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment