Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to find cuurent server and other network computers?

Status
Not open for further replies.

HauntedNinja

Programmer
Dec 14, 2004
2
NL
Hey guys,

I'm looking for the best way to find out what server you're currently logged on to. The next step in this process would be to get a way of showing the user a list of all the current computers that are logged on to it as well.

(Background: I manage the computers at a school, so i'm writing a program which enables me to shutdown computers from my own space (not using 'shutdown' from dos-commands).
But i want to create such a tool that it first checks for all the computers that are turned on and logged into the school network =) ).

Thanks for any help! =D
 
HauntedNinja,

If you are using a domain controller you can call:
DsGetDcName to find the domain controller name.

Also you can use: NetServerEnum to list all servers of a specified type that are visible on the network. This would then give you the names of machines that are actually turned on.

With this function you can use the SV_TYPE_WORKSTATION bitmask for listing workstations and SV_TYPE_SERVER for listing servers or you could combine them and list all.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top