[Samba] How to list members of a workgroup

Adam Williams adam at morrison-ind.com
Fri Oct 3 11:23:33 GMT 2003


> I look for a way to generate a text file, holding the workgroup/user
> relation - which users belongs to a workgroup. Can I use a samba tool to
> list all members of any known group? Or maybe run a domain ctlr, and
> lookup the information in files on the server?
> I must get this info from a M$ lan with arround 20.000 workstations and
> some hudreds servers.

You can list the groups a user is a member of -

$ net user info adam -U adam
adam password:
CIS/IT Staff
HiLow Low Down
Web Developers
Intranet Calendar
Used Equipment
Classroom
Morrison Industrial Equipment
Greenville Branch
...

See ftp://ftp.kalamazoolinux.org/pub/pdf/AbusingWin32.pdf and "man net"

However, listing the member of a group (going in the other direction)
doesn't appear to work yet.  Either in rpclient or using net.

rpcclient $> enumdomgroups
group:[Mail Managers] rid:[0x5e3]
group:[Traverse City Branch] rid:[0x58f]
...
group:[Accounting] rid:[0x57b]
group:[Mor-Value Parts] rid:[0x5c1]
rpcclient $> querygroup
Usage: querygroup rid [info level] [access mask]
rpcclient $> querygroup 5c1
result was NT_STATUS_NO_SUCH_GROUP
rpcclient $> querygroup 0x5c1
result was NT_STATUS_NO_SUCH_GROUP
rpcclient $> queryaliasmem domain 0x5c1
cli_pipe: return critical error. Error was Call timed out: server did
not respond after 10000 milliseconds
result was NT_STATUS_UNSUCCESSFUL
rpcclient $> queryaliasmem domain 5c1
cli_nt_session_open: cli_nt_create failed on pipe \samr to machine
littleboy.  Error was Call timed out: server did not respond after 10000
milliseconds
Could not initialise \PIPE\samr
rpcclient $>

and "net" simply doesn't appear to offer this facility.




More information about the samba mailing list