Hi Team,
We need help as we have many account in wingftp which are set as password based so we need to configure email notification shot for password expiration reaching to threshold XX days
Your help would be appreciable.
Email Alerts notification from sftp accounts before expire
-
- Posts: 12
- Joined: Thu Apr 05, 2018 7:28 am
-
- Site Admin
- Posts: 2083
- Joined: Tue Sep 29, 2009 6:09 am
Re: Email Alerts notification from sftp accounts before expi
Maybe you can use Task scheduler to execute the Lua script (once a day), like the following code:
Code: Select all
do
--Get user list from domain "domain1"
local strUserlist = c_GetUserList("domain1")
local userlist = Split(strUserlist,"\n")
for _,username in pairs(userlist) do
local user = c_GetUser("domain1",username)
local expiretime_t = c_TranslateTime(user.expiretime)
if user.enable_expire == true and (expiretime_t - os.time()) / 3600*24 == 30 then
c_SendMail(user.note_email, "FTP Account Expiration","Dear "..username..",\r\n\r\n Your FTP account will be expired soon...","","SMTP")
end
end
end