How to retrieve a computer comment over the network?

  • Thread starter Thread starter Vangelis
  • Start date Start date
V

Vangelis

Hi,

I'm currently successfully retrieving the list of computers connected on the
differents domains of our network via the
System.DirectoryServices.DirectoryEntry class.

What I'd like to have in addition of the computers name is their comment
(just like when you browse over your network places on XP).

The only way I found is querying the description field of
win32_computersystem (WMI). Unfortunatly, I need to use an authenticated
user/password (for the System.Management.ManagementScope constructor) for
each computers to retrieve the comment (except for my own computer).

Does anybody know if (and how) it is possible to retrieve this comment (when
available), please?

Best regards,


Vangelis
 
You should store the computers "Description" property in the AD.

Willy.
 
Hi Willy,

Thanks for the advice. Unfortunatly, the description returned (set by the
system administrators I presume) does not correspond at all (misspelled user
name and S/N) to the one users can set via the "system properties/computer
name/computer description" control panel (and which is returned by the "my
network places" explorer).

Any idea of how explorer retrieves this information?


Vangelis

========================================
 
Vangelis said:
Hi Willy,

Thanks for the advice. Unfortunatly, the description returned (set by the
system administrators I presume) does not correspond at all (misspelled
user
name and S/N) to the one users can set via the "system properties/computer
name/computer description" control panel (and which is returned by the "my
network places" explorer).

Any idea of how explorer retrieves this information?
Yes, by calling the NetServerEnum API (netapi32.dll), sure you could do the
same using PInvoke, just keep in mind that this API (and another number of
Netxxxx) requires Netbios to be enabled on all Servers/Workstations for this
to work.

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top