Skip to content

Instantly share code, notes, and snippets.

@kevinblumenfeld
Last active June 16, 2017 01:58
Show Gist options
  • Save kevinblumenfeld/7077bc822bf9976d704f9139ba65eb0f to your computer and use it in GitHub Desktop.
Save kevinblumenfeld/7077bc822bf9976d704f9139ba65eb0f to your computer and use it in GitHub Desktop.
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