User auditing?

Please post here if you have problems in using Wing FTP Server.
Post Reply
mherdeen
Posts: 5
Joined: Mon Jan 09, 2012 1:09 pm

User auditing?

Post by mherdeen »

One of my customers is asking if there is a way to find out what users have never logged in to our SFTP site. Is there a simple query or report we can run to see if a user has never logged in?
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: User auditing?

Post by FTP »

You can run the following Lua script under "Administration -> Console":

Code: Select all

local domain = "domain1"
local userlist = Split(c_GetUserList(domain), "\n")
for _,username in pairs(userlist) do
   local user = c_GetUser(domain,username)
   if user ~= nil then
		if user.last_loginip == "" then
			print(username.." has never logged in\n")
		end
   end
end
Just replace the string "domain1" into your own domain name.
mherdeen
Posts: 5
Joined: Mon Jan 09, 2012 1:09 pm

Re: User auditing?

Post by mherdeen »

Thanks for the help - My apologies for not understanding this better, LUA is pretty new to me. When I try to execute the script I get this error:

some error in ... Files (x86)\Wing FTP Server\lua\ServerInterface.lua:1014: bad argument #1 to 'find' (string expected, got nil)!


Any suggestions?
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: User auditing?

Post by FTP »

Did you replace the domain name? And are you using the default XML or database for storing users?
mherdeen
Posts: 5
Joined: Mon Jan 09, 2012 1:09 pm

Re: User auditing?

Post by mherdeen »

Yes, I replaced the domain name and I think we are using xml for users, but I'm not sure. How can I tell?
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: User auditing?

Post by FTP »

Please contact us via email, you had better provide some related screenshots.
Post Reply