You can share your Lua Scripts with everybody here.

Need help with LUA script to list all all users and their fi

Thu Sep 23, 2021 9:35 pm

Can't figure out the variable for the directory path for the user. I have this so far that will give me all expired accounts and the expiration date, but i would also like to list the directory path.

local domain = "basler.com"
local userlist = Split(c_GetUserList(domain), "\n")
for _,username in pairs(userlist) do
local user = c_GetUser(domain,username,dir)
if user.enable_expire == true then
local expiretime = c_TranslateTime(user.expiretime)
local nowtime = os.time()
if nowtime > expiretime then
print(username)
print(";")
print(user.expiretime)
print("\n")
end
end
end

Re: Need help with LUA script to list all all users and thei

Fri Sep 24, 2021 4:43 pm

OK, you can list all the directory path by the following script:

Code:
if user["directories"] ~= nil then
   for _,directory in pairs(user["directories"]) do
      if directory.is_home_dir then
         print("Home dir: "..directory.dir.."\n")
      else
         print("Virtual dir: "..directory.dir.."\n")
      end
   end
   print("\n\n")
end