Page 1 of 1

number of users on domain

Posted: Thu May 06, 2010 2:11 pm
by mellul
Hi,

This may be a bit of a stupid question but I could not find the answer on the documentation. I would like to know if there is a way to know the number of clients on a domain? Is there a command I can run to know? I do not want to know the number of users at this point int time but the total number of users on a domain.

From that would I be able to find the number of users or get a list of the users that have logged into the account over a specified period of time?

I am asking purely for statistical purposes.

Thanks in advance

Re: number of users on domain

Posted: Thu May 06, 2010 2:26 pm
by FTP
print(table.getn(Split(c_GetUserList("DomainName"),"\n")))

Re: number of users on domain

Posted: Mon Jun 21, 2010 1:47 pm
by mellul
Thanks for the reply. It has helped alot.

I need one more thing related to this post - Is it possible to list all the users in a domain and write the usernames to a textfile?

Thanks once again

Re: number of users on domain

Posted: Mon Jun 21, 2010 3:46 pm
by FTP
please check out the following lua script:

Code: Select all

local fh = assert(io.open("c:/userlist.txt", "w+"))
fh:write(c_GetUserList("DomainName"))
fh:close()

Re: number of users on domain

Posted: Tue Jun 22, 2010 6:34 am
by mellul
Worked like a charm :) Thanks

Re: number of users on domain

Posted: Mon Feb 14, 2011 10:40 am
by mellul
I would like to add to the below as I would not only like a list of clients on a domain but also their maximum quota.

Is this possible?

Thanks in advance.

Re: number of users on domain

Posted: Mon Feb 14, 2011 5:34 pm
by FTP
You can get every user's disk quota like this:

Code: Select all

local strUserlist = c_GetUserList("DomainName") 
local userlist = Split(strUserlist,"\n") 

for _,username in pairs(userlist) do 
    local user = c_GetUser("DomainName",username)
    local user_max_quota = user.max_quota
end