getting list of users/machines on NT network


I'm writing a program that requires a list of currently logged in users on
an NT network. Is there a simple way of doing this without entering admin
mode, ie. just in USER MODE.

Also is there a way of getting all names of machines on an NT network. I
know that i can use the shell window thing which enables one to select
'entire network' and then a machine, but i cannot return the machine name
(i don't really know what it is i'm talking about ;-( )

Any help would be appreciated,
Please also post to

Thank you

Gurpal Singh Bhachu,
Department of Computing,
Imperial College,
180 Queen's Gate,
London SW7