Page 1 of 1

User Report - Active Users

Posted: Wed Apr 02, 2025 2:00 pm
by pepsupport
Can we pull a report on the current user set?

Would like to see each user, their active status, last login, account expiry date, etc...

Is this something we can write against the database if it does not exist.

For compliance we have to track the user base monthly

Re: User Report - Active Users

Posted: Thu Apr 03, 2025 9:39 am
by FTP
OK, you can run the following Lua script under "Administrator -> Console", it will export all the user info into a CSV file "d:/all_users_info.csv".
Please replace the first string "YourDomain" into the real domain name:

Code: Select all

local strDomain = "YourDomain"
local strUserlist = c_GetUserList(strDomain)
local userlist = Split(strUserlist,"\n")
local content = "User, Account Enabled, Last Login, Expiry Date\r\n"  


for _,username in pairs(userlist) do
	local user = c_GetUser(strDomain,username)
	if user ~= nil then
		content = content..username..","..tostring(user.enable_account)..","..user.last_logintime..","..user.expiretime.."\r\n"
	end
end

local fp = assert(io.open("d:/all_users_info.csv", "wb+"))
fp:write(string.char(239)..string.char(187)..string.char(191))
fp:write(content)
fp:close()