Page 2 of 2

Re: Forced user password change SFTP

Posted: Wed Sep 29, 2021 7:57 am
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

Re: Forced user password change SFTP

Posted: Wed Sep 29, 2021 1:59 pm
by TeamBas
Worked great thank you! :)