Created
September 2, 2015 11:33
-
-
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)
This file contains 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-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