Thanks Kragen, for hinting that beneath the veneer of Explorer's GAC view, there existed files I could query with the System.IO namespace. Luckily I have network access to each server.
I just needed, for a single assembly, to query the versions that existed in the GAC on many servers. While far from a complete reporting application, this snippet served my purposes nicely:
private static void QueryServerGAC(string IP)
{
string rootPath = String.Format(@"\\{0}\C$\WINDOWS\Assembly", IP);
DirectoryInfo root = new DirectoryInfo(rootPath);
foreach (DirectoryInfo gacDir in root.GetDirectories("GAC*")) // GAC, GAC_32, GAC_MSIL
{
foreach (DirectoryInfo assemDir in gacDir.GetDirectories("MyAssemblyName"))
{
foreach (DirectoryInfo versionDir in assemDir.GetDirectories())
{
string assemVersion = versionDir.Name.Substring(0, versionDir.Name.IndexOf('_'));
foreach (FileInfo fi in versionDir.GetFiles("*.dll"))
{
FileVersionInfo vi = FileVersionInfo.GetVersionInfo(fi.FullName);
Console.WriteLine("{0}\t{1}\t{2}\t{3}", IP, fi.Name, assemVersion, vi.FileVersion);
}
}
}
}
}
This can be called once for each server IP of interest, and prints the IP, DLL Name, Assembly Version, and FileVersion to the console.
Feel free to take this code and modify for your own purposes.