PowerShell 5.0 logo

Get current number of FTP client connections (NonAnonymous) with PowerShell and Get-Counter

Get the current number of active FTP client connections on your Windows Server IIS FTP Service using the Get-Counter cmdlet and the Microsoft FTP Service Current NonAnonymous Users performance counter.

Home » Codebase » Get current number of FTP client connections (NonAnonymous) with PowerShell and Get-Counter

Ever wanted to know the current number of active FTP client connections on your Windows Server IIS FTP Service? You can get this statistic using PowerShell, the Get-Counter cmdlet and the Microsoft FTP Service Current NonAnonymous Users performance counter.

In my case, I have an NLB FTP cluster of three FTP servers, and I wanted know the number of current connected users. They’re non-anonymous, because they’ve authenticated and are logged on.

In PowerShell, use the Get-Counter cmdlet and connect to your FTP servers:

PS C:\Users\jan> Get-Counter `
>>  -ComputerName ftp-01, ftp-02, ftp-03 `
>>  "\Microsoft FTP Service(_total)\Current NonAnonymous Users"
>>

Timestamp                 CounterSamples
---------                 --------------
5/3/2016 1:49:54 PM       \\ftp-01\\microsoft ftp service(_total)\current nonanonymous users :
                          180

                          \\ftp-02\\microsoft ftp service(_total)\current nonanonymous users :
                          133

                          \\ftp-03\\microsoft ftp service(_total)\current nonanonymous users :
                          100

Remove the back ticks (`) to put the command on one line. The Get-Counter cmdlet information on Technet provides more information and samples.

PowerShell #PSTip: List all available IIS FTP Performance Counters

You can use (Get-Counter -ComputerName ftp-01 -ListSet '*').counter to list and display all available performance counters in PowerShell.

One-time donation

Please take a second to support Sysadmins of the North and donate, your generosity helps!

See also  IIS URL Rewrite Module "Rewrite Module error: Expression contains a repeat expression"
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments