number of users on domain

Please post here if you have problems in using Wing FTP Server.
Post Reply
mellul
Posts: 77
Joined: Mon Nov 16, 2009 2:00 pm

number of users on domain

Post 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
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: number of users on domain

Post by FTP »

print(table.getn(Split(c_GetUserList("DomainName"),"\n")))
mellul
Posts: 77
Joined: Mon Nov 16, 2009 2:00 pm

Re: number of users on domain

Post 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
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: number of users on domain

Post 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()
mellul
Posts: 77
Joined: Mon Nov 16, 2009 2:00 pm

Re: number of users on domain

Post by mellul »

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

Re: number of users on domain

Post 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.
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: number of users on domain

Post 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
Post Reply