Hello
I have the below script I have found and edited to export a few pieces of information I need, in particular the Username and group membership of every user. But I get the error as per the below, any pointers appreciated?
some error in ... Files (x86)\Wing FTP Server\lua\ServerInterface.lua:1058: bad argument #1 to 'find' (string expected, got nil)!
Script is:
do
local strDomain = "MYDOMAIN.com"
local strUserlist = c_GetUserList(strDomain)
local userlist = Split(strUserlist,"\n")
local strResult = ""
for _,username in pairs(userlist) do
local user = c_GetUser(strDomain,username)
strResult = strResult..strDomain.."\t"..username.."\t"..user.last_logintime.."\t"..user.expiretime.."\t"..directory.dir.."\n"
end
local fp = assert(io.open("C:\wingtemp\user-info.txt", "wb"))
fp:write(strResult)
fp:close()
end
Thanks
Lua script to export user and Group membership
-
- Posts: 2
- Joined: Wed Sep 02, 2020 8:35 pm
-
- Site Admin
- Posts: 2090
- Joined: Tue Sep 29, 2009 6:09 am
Re: Lua script to export user and Group membership
OK, it means no user account returned by function "c_GetUserList", maybe the domain name "MYDOMAIN.com" is wrong?
-
- Posts: 2
- Joined: Wed Sep 02, 2020 8:35 pm
Re: Lua script to export user and Group membership
Thanks, I have double checked the domain and its spelt and written as in Wing.
If i also run domainlist is shows the name specified.
Its definately failing on that part as i can run other lines ok.
Any ideas why it wint accep the domain? We are on a new build also.
If i also run domainlist is shows the name specified.
Its definately failing on that part as i can run other lines ok.
Any ideas why it wint accep the domain? We are on a new build also.