WMI

Windows WMI staat het dus toe dat je de management informatie van je local of remote computer uitleest. Onderstaand voorbeeld van management informatie ( Configuratie ) van SQL Reporting Services

 

public ReportServerStatus()
{
const string machineWmiNamespace =
@"\\rd04\root\Microsoft\SqlServer\ReportServer\v9\Admin";
const string WmiRSClass = @"\\rd04\root\Microsoft\SqlServer\ReportServer\v9\admin:MSReportServer_ConfigurationSetting";
ConnectionOptions connOptions = new ConnectionOptions();
connOptions.Username = "administrator";
connOptions.Password ="{Troep]" ;
ObjectGetOptions getOptions = new ObjectGetOptions();
getOptions.Timeout = new System.TimeSpan(0, 0, 30);
ManagementScope machineScope =
new ManagementScope(machineWmiNamespace, connOptions);
machineScope.Connect();
//ManagementPath path = new ManagementPath("MSReportServer_Instance");
ManagementClass serverClass = new ManagementClass(WmiRSClass);
serverClass.Get();
ManagementObjectCollection instances = serverClass.GetInstances();
foreach (ManagementObject instance in instances)
{
PropertyDataCollection instProps = instance.Properties;
foreach (PropertyData prop in instProps)
{
System.Windows.Forms.MessageBox.Show(prop.Name );
}
}
}


{{opmerking.Naam}}:

{{opmerking.OpmerkingText}}

            

Saving your comment....

Naam is verplicht!
Email is verplicht!
Opmerking is verplicht!