Skip to content

Instantly share code, notes, and snippets.

@josephkern
Created September 2, 2015 11:33
Show Gist options
  • Save josephkern/d825fe8475b43cda72e6 to your computer and use it in GitHub Desktop.
Save josephkern/d825fe8475b43cda72e6 to your computer and use it in GitHub Desktop.
A Powershell cmdlet to help discover which CAS Server a user has been using (Requires Exchange Management Shell)
function Get-CASServer {
<#
.SYNOPSIS
A Powershell cmdlet to help discover which CAS Server a user has been using
(Requires Exchange Management Shell to be running during execution)
.PARAMETER Alias
The exchange user alias.
Will take pipeline input from get-mailbox.
.EXAMPLE
Get-Mailbox joseph.kern | Get-CASServer |
select ApplicationID, ServerName, clientname, lastaccesstime, Windows2000Account
.NOTES
Cleaned up from
http://serverfault.com/questions/559687/is-there-a-way-to-determine-which-exchange-2010-cas-server-a-user-is-connecting
#>
[CmdletBinding()]
param (
[Parameter(Position=0, ParameterSetName="Pipeline", ValueFromPipelineByPropertyName=$true, Mandatory=$true)]
[String]$Alias
)
Get-LogonStatistics -Identity $Alias | ? {$_.applicationid -eq "Client=MSExchangeRPC"}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment