number of users on domain

Please post here if you have problems in using Wing FTP Server.

number of users on domain

Postby mellul » Thu May 06, 2010 2:11 pm

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
mellul
 
posts 77
 
joined Mon Nov 16, 2009 2:00 pm

Re: number of users on domain

Postby FTP » Thu May 06, 2010 2:26 pm

print(table.getn(Split(c_GetUserList("DomainName"),"\n")))
FTP
Site Admin
 
posts 1215
 
joined Tue Sep 29, 2009 6:09 am

Re: number of users on domain

Postby mellul » Mon Jun 21, 2010 1:47 pm

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
mellul
 
posts 77
 
joined Mon Nov 16, 2009 2:00 pm

Re: number of users on domain

Postby FTP » Mon Jun 21, 2010 3:46 pm

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()
FTP
Site Admin
 
posts 1215
 
joined Tue Sep 29, 2009 6:09 am

Re: number of users on domain

Postby mellul » Tue Jun 22, 2010 6:34 am

Worked like a charm :) Thanks
mellul
 
posts 77
 
joined Mon Nov 16, 2009 2:00 pm

Re: number of users on domain

Postby mellul » Mon Feb 14, 2011 10:40 am

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.
mellul
 
posts 77
 
joined Mon Nov 16, 2009 2:00 pm

Re: number of users on domain

Postby FTP » Mon Feb 14, 2011 5:34 pm

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
FTP
Site Admin
 
posts 1215
 
joined Tue Sep 29, 2009 6:09 am


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron