Forced user password change SFTP

Please post here if you have problems in using Wing FTP Server.
FTP
Site Admin
Posts: 1917
Joined: Tue Sep 29, 2009 6:09 am

Re: Forced user password change SFTP

Post by FTP »

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
TeamBas
Posts: 11
Joined: Wed Sep 15, 2021 8:59 am

Re: Forced user password change SFTP

Post by TeamBas »

Worked great thank you! :)
Post Reply