blackadder has asked for the wisdom of the Perl Monks concerning the following question:

PLEASE HELP

I have a list of server names and I need to determine their role or type, I did some homework yesterday and I found that using this;

Win32::Lanman::NetServerGetInfo($server, \%info, 1)

Will get me a lot of information but none of it refers to the type of the server (i.e. if it’s a PDC, BDC, DC, member server, SQL server, Exchange server, Notes server,.,..etc) I think so, although I am not sure.

Then I looked at NetServerEnum($server, $domain, $type, \@info) this won't fit my requirements because I have to specify that the type of server I am looking for.

I've searched few places that deals with perl still to no avail, I check Dave Roths books and other libraries such as AdminMisc and found almost every example or command deals with scanning a whole domain and retrieving a list of specific servers, I couldn't find anything anywhere that tests a server name for me and returns it type or Role, I have posted my question on PM and did not get any response, which leads me to think "Is this possible have I found something that Perl can't do at last"???

Your guidance is highly appreciated.

Many Thanks

Replies are listed 'Best First'.
Re: Remote Server Types
by AcidHawk (Vicar) on Jul 03, 2003 at 11:58 UTC

    have you looked at

  • Remote server OS identification
  • Re: How do *you* secure your network with Perl?

    They seem to point at fingerprinting.. have a look at winfingerprinting

    Winfingerprint is a Win32 MFC VC++ .NET based security tool that is able to Determine OS, enumerate users, groups, shares, SIDs, transports, sessions, services, service pack and hotfix level, date and time, disks, and open tcp and udp ports

    -----
    Of all the things I've lost in my life, its my mind I miss the most.
Re: Remote Server Types
by BrowserUk (Patriarch) on Jul 03, 2003 at 21:47 UTC

    In the hash %info returned by Win32::Lanman::NetServerGetInfo($server, \%info, 1) there is a key 'type' that has a numeric value. This is a 32-bit bitstring, the bits of which denote the various types of server. These bits can be decoded by ANDing with the SV_TYPE_* constants that are exported by the module.

    This script demonstrates how to get at the info. It a shame that the module doesn't export the vast array of constants as a hash in the first place, it would make using them a whole lot easier:)


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller