私はSystem.DirectoryServicesネットワークを使用してサーバー上のマシンを取得する方法を知っています。 問題は、ネットワーク上のワークステーションやコンピュータを無視して、サーバーのみを取得することです。ネットワーク上のワークステーションとサーバーの違いをどのように把握していますか?
誰かがOSのバージョンを確認すると言う場合、Windows NTファミリのOSバージョン番号を取得する際の問題は、各番号がサーバと非サーバOSの両方に対応する可能性があることです(NTバージョン6.1がWin 7およびWindows Server 2008 R2)。代わりにoperatingSystemVersion
財産で行くの
namespace Project1
{
class Class1
{
public static void Main(string[] args)
{
List<string> list = Class1.GetComputersOnNetwork();
}
public static List<string> GetComputersOnNetwork()
{
string fileName = "networkcomputers.txt";
// Delete the file if it exists.
if (System.IO.File.Exists(fileName))
{
System.IO.File.Delete(fileName);
}
// Create the file.
System.IO.FileStream fs = System.IO.File.Create(fileName, 1024);
StreamWriter strwr = new StreamWriter(fs);
int i = 0;
List<string> list = new List<string>();
DirectoryEntry root = new DirectoryEntry("WinNT:");
foreach (DirectoryEntry computers in root.Children)
{
if ((computers.Name != "Schema"))
{
i++;
Console.WriteLine("Machine Number " + i + ": " + computers.Name);
strwr.WriteLine("Machine Number " + i + ": " + computers.Name);
list.Add(computers.Name);
}
}
return list;
}
}
}
RPCはサーバーで有効になっていて、アプリケーションからアクセスできますか?たとえば、RPCを使用してリモートマシンのレジストリに照会することができます。 – mellamokb
"server"とは、特定の種類の動作やインストールされたサービスではなく、「WindowsのサーバーSKUの実行」を意味しますか? – MNGwinn
mellamokb 私はそれを調べます。 @MNGwinn はい、それは私が言及しているものです。 – praetor