rpcclient / srvmgr.exe

Luke Kenneth Casson Leighton lkcl at switchboard.net
Tue Aug 17 20:18:42 GMT 1999


On Tue, 17 Aug 1999, Michael Glauche wrote:

> another one : Where can I find information of the rpcclient commands,
> and what they
> should issue ? (or just try and watch an NT server ? :)
> 
> srvconnections allerady tells me the correct number of connections, but
> I have a few problems with it :
> 
> srvconnections 1
> 
> Connection Info Level 1:
> 	id       :	0        
> 	type     :	Disk
> 	num_opens:	1
> 	num_users:	1
> 	open_time:	30
> 	user name:	dummy_user
> 	net  name:	tmp
> 
> id : on nt side this is some kind of auto-increment variable, that
> increases per connection. Any hints where I can get such a number ? 

ok, you'll have to create one.  the "enumerate" function that reads
STATUS..LCK?  give it a starting index, and have it "skip" that number of
entries, and start from there.

this is probably the best first-pass solution.


> type,open is ok, but what is num_users ?

num_users is going to be the number of users on that connection.  the smb
protocol allows multiple users to connect over an SMB connection, e.g
WinDD, NTrigue and TSE.  you set a "virtual userid" or a "mid" or
something, i don't know enough about it.

unless there is something already in STATUS..LCK, just report "1" user.
basically you are telling us that STATUS..LCK needs to be re-evaluated.

> And NT srvmgr seems to ignore
> my open_time .. :( (it is allways set to 00:00 !?!?)
> Another problem is, that in srvmgr I see all connections on each share,
> i.e. if there is some user connected to tmp, the user count in IPC$ will
> also go up. How does srvmgr compute these ?

srvmgr isn't doing _any_ counting at all, it's calling MSDN functions that
report information from a remote machine.  that's the way _all_ of these
NT remote admin tools work.

> I did not see any rpcclient command to tell how many open files a
> share has ?

there isn't one: there is no such MSDN call to do this that neither srvmgr
calls nor rpcclient can equivalent-call.  there _is_ however a srvfiles
command which is NetFileEnum() in srvmgr / MSDN.

luke



More information about the samba-technical mailing list