How can I list the expired account list?

Please post here if you have problems in using Wing FTP Server.
Post Reply
nicklu
Posts: 1
Joined: Tue Jan 03, 2017 8:42 am

How can I list the expired account list?

Post 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!
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: How can I list the expired account list?

Post 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
Post Reply