简体   繁体   中英

Find servers using Active Directory

is it possible to query Active Directory for servers?

In detail I want to retrieve information about instances of SQL Server / Sharepoint / IIS / and AnalysisServices servers of a domain using C#.

Which attributes do I have to check in order to find out which service is running on a machine?

If it is not possible to get this information from Active Directory, any other ideas are welcome.

Here's a CodeProject article which creates and demonstrates a general-purpose network server enumerator - you can pick what type of server(s) you're interested in, and have a list of server matching that criteria enumerated from your network. It uses routines from the netapi32.dll and surfaces them in a nice, C# compatible way.

替代文字

Pretty slick stuff!

In AD, of course, you could also enumerate the servers based on the ObjectCategory - but I'm not sure if and how you could distinguish them into separate roles (SQL server, DC etc.).

Another CodeProject article shows how to enumerate objects in general in AD - you can definitely enumerate the computers ( objectCategory=computer ) from AD, but I'm not sure you can limit what you'll get back ahead of time with an LDAP filter...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM