Forced user password change SFTP

Please post here if you have problems in using Wing FTP Server.

Re: Forced user password change SFTP

Postby FTP » Wed Sep 29, 2021 7:57 am

OK, please try the following Lua script:

Code: Select all
local domain = "YourDomainName"

local userlist = Split(c_GetUserList(domain), "\n")
for _,username in pairs(userlist) do

local user = c_GetUser(domain, username)
for k,v in pairs(user) do
if type(v) == "boolean" then
if v == true then
user[k] = 1
else
user[k] = 0
end
end
end

user.oldpassword = user.password


user.change_pass = 1
user.pass_length = 14
AddUser(domain, user)
c_ResetUserLoginIP(domain, username)

end
FTP
Site Admin
 
1876
 
Tue Sep 29, 2009 6:09 am

Re: Forced user password change SFTP

Postby TeamBas » Wed Sep 29, 2021 1:59 pm

Worked great thank you! :)
TeamBas
 
8
 
Wed Sep 15, 2021 8:59 am

Previous

Return to Support

Who is online

Users browsing this forum: Google [Bot] and 2 guests