Page 1 of 1

How can I list the expired account list?

Posted: Wed Jan 04, 2017 7:41 am
by nicklu
Dear All,

Because we have many accounts in Wing ftp server. How can I list the expired account list? I want to delete them.

Thanks for your reply!

Re: How can I list the expired account list?

Posted: Tue Jan 10, 2017 3:28 pm
by FTP
OK, you can use the following Lua script to print all the expired accounts:

Code: Select all

local mydomain = "YourDomainName"
do
 local strUserlist = c_GetUserList(mydomain)
 local userlist = Split(strUserlist,"\n")

 for _,username in pairs(userlist) do
 local user = c_GetUser(mydomain,username)
 local expiretime_t = c_TranslateTime(user.expiretime)
 if (os.time() > expiretime_t) and (user.enable_expire == true) then
 print(username.."\n")
 end
 end
end