Powershell script help - get-logonstatistics

Hello,

I am looking to see who has gone over the default RCAMaxConcurrency value of 20. 

For a single user, I can use get-logonstatistics -identity "user" | fl applicationid  This script will return multiple occurrences of applicationid which assists in understanding what the single user is using in terms of RCA connections.  

How do I search all of the mailboxes and only output those users with applicationid occurrences greater than 20?

Once I identify the users over 20, I can add them to a new throttling policy.

Thanks

Ron

April 15th, 2015 6:24pm

I haven't tested this but based on your example, try this:

Get-Mailbox -ResultSize Unlimited | Get-LogonStatistics | Where {($_.Application).Count -gt 20}

I have read that this cmdlets is depreciated or removed from Exchange 2013.

Free Windows Admin Tool Kit Click here and download it now
April 15th, 2015 11:20pm

Thanks Ed.

I'll give it a try tomorrow morning.

Ron

April 16th, 2015 1:04am

Ed,

The following cmdlet didn't work.

Get-Mailbox -ResultSize Unlimited | Get-LogonStatistics | Where {Get-Mailbox -ResultSize Unlimited | Get-LogonStatistics | Where {($_.Application).Count -gt 20}.Count -gt 20}

Ar first, I tried decreasing "-gt 20" to 5,  and nothing returned.  Then, I tried changing "($_.Application)" to "($_.ApplicationID)" and still no results.

What's missing?

Thanks

Ron

Free Windows Admin Tool Kit Click here and download it now
April 17th, 2015 8:47pm

Oops.  Cleaned up reply.

Ed,

The following cmdlet didn't work.

Get-Mailbox -ResultSize Unlimited | Get-LogonStatistics | Where {($_.Application).Count -gt 20}

Ar first, I tried decreasing "-gt 20" to 5,  and nothing returned.  Then, I tried changing "($_.Application)" to "($_.ApplicationID)" and still no results.

What's missing?

Thanks

Ron

April 19th, 2015 4:15pm

Sorry, I don't have a system I can test this on right now.

First do this:

Get-Mailbox -Identity "Your Name" | Get-LogonStatistics | FL

and see what's returned, and from that you can try to limit the results based on an appropriate property.

Free Windows Admin Tool Kit Click here and download it now
April 19th, 2015 8:04pm

Ed,

I piped the following to a text file and scanned through the text file for high usage.  Get-Mailbox | Get-LogonStatistics | FT username,applicationid

It worked for my purposes since we have medium size organization.  But, I would still like to figure out a PS script to do this.

Thanks

Ron

April 24th, 2015 1:11pm

What are you trying to see with the ApplicationId?
Free Windows Admin Tool Kit Click here and download it now
April 24th, 2015 4:23pm

I'm trying to count the number of occurrence's of applicationid per mailbox. I'm trying to determine if any mailboxes are going above the default 20 for RCAMaxConcurrency.

Thanks

Ron

April 27th, 2015 11:43am

The total number of unique application IDs, or the total instances?
Free Windows Admin Tool Kit Click here and download it now
April 27th, 2015 12:27pm

Just the total instances.

Ron

April 27th, 2015 12:34pm

Try this.  You might have to futz with it since I didn't test it.

$MBs = Get-Mailbox -ResultSize Unlimited
ForEach ($MB in $MBs) {
  $Count = (($MB | Get-LogonStatistics).ApplicationCount).Count
  If ($LS -gt 20) {
    $Name = $MB.DisplayName
    "$Name has $Count ApplicationIDs."
  }
}

If it doesn't work for you, try each step along the way interactively to verify you're getting the results you expect and modify if as appropriate.

Free Windows Admin Tool Kit Click here and download it now
April 27th, 2015 12:53pm

Cool. I'll give it a try.

Thanks

Ron

April 27th, 2015 12:55pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics