protected void connect(string sHostname, string username, string password) { oWMIProvider = new WMI.Provider(@"\\" + sHostname + @"\ROOT\cimv2", username, password); connect(oWMIProvider); pHostname = sHostname; pUsername = username; pPassword = password; }
protected void connect(WMI.Provider wmiProv) { oWMIProvider = wmiProv; oSMSSchedules = new SMS.Schedules(oWMIProvider); oWMIRegistry = new WMI.Registry(oWMIProvider); oWMIServices = new WMI.Services(oWMIProvider); oSMSSoftwareDistribution = new SMS.SoftwareDistribution(oWMIProvider); oWMIWindowsInstaller = new WMI.WindowsInstaller(oWMIProvider); oWMIFileIO = new WMI.FileIO(oWMIProvider); oWMIComputerSystem = new WMI.ComputerSystem(oWMIProvider); oSMSComponents = new SMS.Components(oWMIProvider); oSMSDCM = new SMS.DesiredConfigurationManagement(oWMIProvider); }