Other than going thru the log file for each day, is there a way the I can find out which "users" have logged into the FTP Server, and when the last time was that they logged in? I have a lot of users and some I'm finding have never logged in or very rarely log into the server. I would like to remove those users who have never logged in. It would be nice to show last logged in date within the window where you setup each user.
mike
Tracking User logins
Moderator: Project members
Re: Tracking User logins
Going through the log is the only way to do it right now.
-
- 500 Command not understood
- Posts: 2
- Joined: 2015-03-03 18:51
- First name: Michael
- Last name: Babb
Re: Tracking User logins
Thanks. Hopefully this is something that others have interest in and can be added as a new feature down the road.botg wrote:Going through the log is the only way to do it right now.
-
- 500 Command not understood
- Posts: 1
- Joined: 2020-01-28 18:49
- First name: LT
- Last name: Tiwana
Re: Tracking User logins
I was in the same situation where we need to find active users and migrate them to new servers. So I created a PowerShell script to break down the log files and provide me with username and timestamp.
if you have logging enabled then something like this would work through PowerShell:
if you have logging enabled then something like this would work through PowerShell:
Code: Select all
$FileZillaLogs = $null
$FileZillaUsers = @()
## Use this line to only look at one log file
$FileZillaLogs = Get-Content "C:\Program Files (x86)\FileZilla Server\Logs\fzs-2020-01-13.log"
## OR
## Uncomment this line to look at all the files in log folder
#$FileZillaLogs = Get-Content "C:\Program Files (x86)\FileZilla Server\Logs\*.log"
foreach ($Line in $FileZillaLogs) {
$Date = $Null
$Username = $Null
if ($Line -match '> USER') {
$Line -match "\d{2}\/\d{2}\/\d{4} \d{1,2}:\d{1,2}:\d{1,2} (A|P)M" | Out-Null
$Date = $Matches[0]
$Username = ($Line -split "USER ")[1].trim()
$FileZillaUsers += [PSCustomObject]@{
Date = $Date
Username = $Username
}
}
}
# Display the results
$FileZillaUsers | FT -autosize
# Export the infomraton to a csv file
$FileZillaUsers | Export-Csv FileZillaUsers.csv -NoTypeInformation