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
User Report - Active Users
-
- Site Admin
- Posts: 2120
- Joined: Tue Sep 29, 2009 6:09 am
Re: User Report - Active Users
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:
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()