According to sources here and here, this class should give me a nice and human-readable list of patches applied to Windows. What I want is a list of KB patches applied to a remote machine.
ManagementScope scope;
ConnectionOptions options = new ConnectionOptions();
options.Username = tbUsername.Text;
options.Password = tbPassword.Password;
options.Authority = String.Format("ntlmdomain:{0}", tbDomain.Text);
scope = new ManagementScope(String.Format("\\\\{0}\\root\\cimv2", tbHost.Text), options);
scope.Connect();
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, new ObjectQuery("SELECT * FROM Win32_PatchPackage"));
foreach (ManagementObject queryObj in searcher.Get())
{
wmiResults.Text += String.Format("{0}: {1} {2}\n",
queryObj["PatchID"],
queryObj["Caption"],
queryObj["Description"]);
}
Instead, what I get is this GUID-like smorgasbord. Am I looking for things in the wrong place?
{0B36C6D6-F5D8-4EAF-BF94-4376A230AD5B}: {0B36C6D6-F5D8-4EAF-BF94-4376A230AD5B} {0B36C6D6-F5D8-4EAF-BF94-4376A230AD5B}
{3D019598-7B59-447A-80AE-815B703B84FF}: {3D019598-7B59-447A-80AE-815B703B84FF} {3D019598-7B59-447A-80AE-815B703B84FF}
{5ECEB317-CBE9-4E08-AB10-756CB6F0FB6C}: {5ECEB317-CBE9-4E08-AB10-756CB6F0FB6C} {5ECEB317-CBE9-4E08-AB10-756CB6F0FB6C}
{69F52148-9BF6-4CDC-BF76-103DEAF3DD08}: {69F52148-9BF6-4CDC-BF76-103DEAF3DD08} {69F52148-9BF6-4CDC-BF76-103DEAF3DD08}
{71127777-8B2C-4F97-AF7A-6CF8CAC8224D}: {71127777-8B2C-4F97-AF7A-6CF8CAC8224D} {71127777-8B2C-4F97-AF7A-6CF8CAC8224D}
{7559E742-FF9F-4FAE-B279-008ED296CB4D}: {7559E742-FF9F-4FAE-B279-008ED296CB4D} {7559E742-FF9F-4FAE-B279-008ED296CB4D}
...etc...